Prepare for event system
Moved stuff around. Create an entry point for RSE. Created base for events module Signed-off-by: Piotr Krygier <piotrkrygier@everyonecancode@xyz>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
#include "red_scarf_engine.h"
|
||||
#include "graphics/rse_graphics.h"
|
||||
#include "graphics/src/graphics_context.h"
|
||||
#include "utilities/commons.h"
|
||||
#include "utilities/errors_common.h"
|
||||
#include "utilities/time_utils.h"
|
||||
|
||||
struct rse_context_t {
|
||||
struct graphics_context_t graphics_context;
|
||||
};
|
||||
|
||||
rse_err_t rse_init(rse_context* context)
|
||||
{
|
||||
rse_err_t status = RSE_ERROR_NO_ERROR;
|
||||
struct rse_context_t* rse_context = NULL;
|
||||
|
||||
rse_malloc(*context, sizeof(struct rse_context_t));
|
||||
|
||||
rse_context = *context;
|
||||
|
||||
SDL_SetLogPriorities(SDL_LOG_PRIORITY_VERBOSE);
|
||||
|
||||
STATUS_CHECK(time_init());
|
||||
rse_graphics_init(&(rse_context->graphics_context));
|
||||
|
||||
return RSE_ERROR_NO_ERROR;
|
||||
}
|
||||
|
||||
rse_err_t rse_run(rse_context context)
|
||||
{
|
||||
rse_err_t status = RSE_ERROR_NO_ERROR;
|
||||
|
||||
STATUS_CHECK(rse_graphics_test_function(&context->graphics_context));
|
||||
|
||||
STATUS_CHECK(rse_graphics_main_loop(&context->graphics_context));
|
||||
|
||||
rse_free(context);
|
||||
|
||||
return status;
|
||||
}
|
||||
Reference in New Issue
Block a user