diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f52cd4..b55c592 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,9 @@ else() endif() if (SK_IS_MAIN) + add_executable(${PROJECT_NAME}_app seika/main.c) + target_link_libraries(${PROJECT_NAME}_app ${PROJECT_NAME}) + # Create seika test exe add_executable(${PROJECT_NAME}_test test/test.c) target_link_libraries(${PROJECT_NAME}_test ${PROJECT_NAME} unity) diff --git a/seika/rendering/renderer.c b/seika/rendering/renderer.c index e9bf40b..6db3ed5 100644 --- a/seika/rendering/renderer.c +++ b/seika/rendering/renderer.c @@ -248,7 +248,7 @@ static void ska_renderer_flush_batches() { SKA_STATIC_ARRAY_EMPTY(active_render_layer_items_indices); } -void ska_renderer_process_and_flush_batches(const SkaColor *backgroundColor) { +void ska_renderer_process_and_flush_batches(const SkaColor* backgroundColor) { #ifdef SKA_RENDER_TO_FRAMEBUFFER ska_frame_buffer_bind(); #endif diff --git a/seika/seika.c b/seika/seika.c index 103b480..397cb67 100644 --- a/seika/seika.c +++ b/seika/seika.c @@ -9,6 +9,7 @@ #include "logger.h" #include "input/sdl_input.h" #include "seika/assert.h" +#include "seika/rendering/renderer.h" #define SKA_AUDIO_SOURCE_DEFAULT_WAV_SAMPLE_RATE 44100 #define SKA_WINDOW_DEFAULT_MAINTAIN_ASPECT_RATIO false @@ -181,6 +182,9 @@ bool ska_window_init2(const char* title, int32 windowWidth, int32 windowHeight, return false; } + // Initialize rendering + ska_renderer_initialize(windowWidth, windowHeight, resolutionWidth, resolutionHeight, maintainAspectRatio); + SKA_ADD_FLAGS(skaState.runningSystems, SkaSystemFlag_WINDOW); return true; } @@ -197,8 +201,8 @@ void ska_window_shutdown() { void ska_window_render() { SKA_ASSERT(SKA_HAS_FLAG(SkaSystemFlag_WINDOW, skaState.runningSystems)); - glClearColor(0.2f, 0.2f, 0.2f, 1.0f); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + static const SkaColor backgroundColor = {33.0f / 255.0f, 33.0f / 255.0f, 33.0f / 255.0f, 1.0f }; + ska_renderer_process_and_flush_batches(&backgroundColor); SDL_GL_SwapWindow(window); }