Refactor project
Crealned up some TODOs, FIXMEs etc. Added better error handling. Looks better, feels better.
This commit is contained in:
1 parent
bd4dd74881
commit
42dc4d6fcd
29 files changed
+750
-645
No files matched your search
+20
-12
@@ -5,13 +5,17 @@
|
||||
#include "mesh_controller.h"
|
||||
#include "vulkan_commons.h"
|
||||
#include "rse_vulkan_image.h"
|
||||
#include "utilities/logger.h"
|
||||
#include "utilities/rse_commons.h"
|
||||
#include "utilities/rse_errors_common.h"
|
||||
|
||||
#include "rse_math.h"
|
||||
|
||||
extern struct rse_vulkan_state_t g_vulkan_state;
|
||||
|
||||
void rse_graphics_init(void)
|
||||
rse_err_t rse_graphics_init(void)
|
||||
{
|
||||
rse_err_t status = RSE_ERROR_NO_ERROR;
|
||||
g_vulkan_state.graphics_queue = VK_NULL_HANDLE;
|
||||
g_vulkan_state.physical_device = VK_NULL_HANDLE;
|
||||
g_vulkan_state.current_frame = 0U;
|
||||
@@ -21,17 +25,22 @@ void rse_graphics_init(void)
|
||||
g_vulkan_state.pipeline_layout = VK_NULL_HANDLE;
|
||||
g_vulkan_state.swapchain = VK_NULL_HANDLE;
|
||||
|
||||
window_init();
|
||||
STATUS_CHECK(window_init());
|
||||
STATUS_CHECK(preinit_vulkan());
|
||||
|
||||
if (0 != preinit_vulkan())
|
||||
return;
|
||||
return status;
|
||||
}
|
||||
|
||||
void rse_graphics_test_function(void)
|
||||
{
|
||||
int8_t tex_id_2 = 0;
|
||||
rse_err_t status = RSE_ERROR_NO_ERROR;
|
||||
uint8_t tex_id_2 = 0;
|
||||
|
||||
tex_id_2 = rse_load_texture("../../test_image.png");
|
||||
status = rse_load_texture("../../test_image.png", &tex_id_2);
|
||||
if (status != RSE_ERROR_NO_ERROR) {
|
||||
LOGE("Failed to do something. Check error messages");
|
||||
return;
|
||||
}
|
||||
|
||||
// FIXME: Temporary array of vertices, for testing purposes
|
||||
struct rse_vertex_t vertices[] = {{{-0.5f, -0.5f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 0.0f}},
|
||||
@@ -71,17 +80,16 @@ void rse_graphics_test_function(void)
|
||||
});
|
||||
}
|
||||
|
||||
uint8_t rse_graphics_run(void)
|
||||
rse_err_t rse_graphics_run(void)
|
||||
{
|
||||
if (0 != init_vulkan()) {
|
||||
return -1;
|
||||
}
|
||||
rse_err_t status = RSE_ERROR_NO_ERROR;
|
||||
STATUS_CHECK(init_vulkan());
|
||||
|
||||
window_loop();
|
||||
STATUS_CHECK(window_loop());
|
||||
|
||||
deinit_vulkan();
|
||||
|
||||
window_terminate();
|
||||
|
||||
return 0;
|
||||
return status;
|
||||
}
|
||||
Reference in new issue
Block a user