Refactor project

Crealned up some TODOs, FIXMEs etc. Added better error handling. Looks
better, feels better.
This commit is contained in:
Piotr Krygier committed 2023-10-10 10:46:12 +02:00
1 parent bd4dd74881
commit 42dc4d6fcd
29 files changed
+750 -645

No files matched your search

+5 -12
View File
@@ -13,16 +13,9 @@
#include "locale_window.h"
#include "utilities/logger.h"
#include "utilities/rse_errors_common.h"
#include "vulkan_base.h"
/* Error codes */
typedef enum {
WINDOW_ERROR_NO_ERROR = 0U,
WINDOW_ERROR_GLFW_INIT_FAILED,
WINDOW_ERROR_VULKAN_NOT_LOADED,
WINDOW_ERROR_WINDOW_NOT_CREATED
} WINDOW_ERROR;
GLFWwindow *g_window_handle = NULL;
/**
@@ -58,7 +51,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
}
uint16_t window_init()
rse_err_t window_init()
{
/* Initiliaze GLFW AP */
if (GLFW_TRUE != glfwInit())
@@ -89,17 +82,17 @@ uint16_t window_init()
glfwSetKeyCallback(g_window_handle, key_callback);
return WINDOW_ERROR_NO_ERROR;
return RSE_ERROR_NO_ERROR;
}
uint16_t window_loop()
rse_err_t window_loop()
{
while (!glfwWindowShouldClose(g_window_handle)) {
glfwPollEvents();
draw_frame();
}
return WINDOW_ERROR_NO_ERROR;
return RSE_ERROR_NO_ERROR;
}
void window_terminate()