Started using ev_log
Signed-off-by: Robear Selwans <robear.selwans@outlook.com>
This commit is contained in:
15
main.c
15
main.c
@@ -1,6 +1,7 @@
|
||||
#include <evk/evk.h>
|
||||
#include <ev_numeric.h>
|
||||
#include <ev_helpers.h>
|
||||
#include <ev_log.h>
|
||||
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include <GLFW/glfw3.h>
|
||||
@@ -30,10 +31,10 @@ int main(void)
|
||||
|
||||
if(instance.vk == EV_INVALID(VkInstance))
|
||||
{
|
||||
puts("Instance creation failed.");
|
||||
ev_log_error("Instance creation failed.");
|
||||
goto InstanceCreationFailed;
|
||||
}
|
||||
puts("Instance was created successfully.");
|
||||
ev_log_info("Instance was created successfully.");
|
||||
|
||||
evkDevice device = evkCreateDevice((evkDeviceCreateInfo) {
|
||||
.instance = instance,
|
||||
@@ -58,17 +59,17 @@ int main(void)
|
||||
|
||||
if(device.vk == EV_INVALID(VkDevice))
|
||||
{
|
||||
puts("Couldn't create a VkDevice");
|
||||
ev_log_error("Couldn't create a VkDevice");
|
||||
goto DeviceCreationFailed;
|
||||
}
|
||||
ev_log_info("Logical Device created successfully.");
|
||||
|
||||
puts("Logical Device created successfully.");
|
||||
VkQueue graphicsQueue;
|
||||
vkGetDeviceQueue(device.vk, device.queueFamilies[VK_QUEUE_GRAPHICS_BIT].familyIndex, 0, &graphicsQueue);
|
||||
|
||||
if (!glfwInit())
|
||||
{
|
||||
puts("GLFW Initialization failed.");
|
||||
ev_log_error("GLFW Initialization failed.");
|
||||
goto GLFWInitFailed;
|
||||
}
|
||||
|
||||
@@ -76,7 +77,7 @@ int main(void)
|
||||
GLFWwindow* window = glfwCreateWindow(1024,1024, "evk", NULL, NULL);
|
||||
if(!window)
|
||||
{
|
||||
puts("Window Creation Failed.");
|
||||
ev_log_error("Window Creation Failed.");
|
||||
goto WindowCreationFailed;
|
||||
}
|
||||
|
||||
@@ -84,8 +85,8 @@ int main(void)
|
||||
VkResult err = glfwCreateWindowSurface(instance.vk, window, NULL, &surface);
|
||||
if (err)
|
||||
{
|
||||
ev_log_error("Surface creation failed.");
|
||||
goto VKSurfaceCreationFailed;
|
||||
puts("Surface creation failed.");
|
||||
}
|
||||
|
||||
evkGPUAllocator allocator = evkGPUCreateAllocator(device);
|
||||
|
||||
Reference in New Issue
Block a user