Initial commit
This is working repository now. I had to clean this up due to my f_ups, that made this simple repo around 200MB large. Signed-off-by: Piotr Krygier <piotrkrygier@everyonecancode@xyz>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
|
||||
|
||||
add_executable(${PROJECT_NAME} src/main.c)
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE
|
||||
${CMAKE_SOURCE_DIR})
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||
graphics
|
||||
utilities)
|
||||
@@ -0,0 +1,18 @@
|
||||
red_scarf_engine_srcs = [
|
||||
'src/main.c'
|
||||
]
|
||||
|
||||
sdl3_dep = dependency('sdl3',
|
||||
version : '>=3.4.0')
|
||||
|
||||
executable(
|
||||
'RedScarfEngine',
|
||||
red_scarf_engine_srcs,
|
||||
include_directories : [
|
||||
'../'
|
||||
],
|
||||
dependencies : [
|
||||
sdl3_dep,
|
||||
],
|
||||
link_with: rse_graphics_lib,
|
||||
)
|
||||
@@ -0,0 +1,31 @@
|
||||
#include <SDL3/SDL_init.h>
|
||||
#include <SDL3/SDL_log.h>
|
||||
#include "graphics/rse_graphics.h"
|
||||
#include "utilities/errors_common.h"
|
||||
#include "SDL3/SDL_thread.h"
|
||||
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
rse_err_t status = RSE_ERROR_NO_ERROR;
|
||||
struct rse_graphics_context_t* context = NULL;
|
||||
SDL_Thread* graphics_task = NULL;
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
|
||||
SDL_SetLogPriorities(SDL_LOG_PRIORITY_VERBOSE);
|
||||
|
||||
STATUS_CHECK(rse_graphics_init(&context));
|
||||
STATUS_CHECK(rse_graphics_test_function(context));
|
||||
|
||||
graphics_task = SDL_CreateThread(rse_graphics_run, "graphics_task", (void*) context);
|
||||
|
||||
if (NULL == graphics_task) {
|
||||
SDL_LogCritical(SDL_LOG_CATEGORY_GPU, "Failed to create graphics task");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
SDL_WaitThread(graphics_task, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user