my local debugging
This commit is contained in:
8
c/sdl.c
8
c/sdl.c
@@ -1,7 +1,9 @@
|
||||
#include <stdint.h>
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_error.h>
|
||||
#include <SDL3_image/SDL_image.h>
|
||||
#include <lean/lean.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static SDL_Window* g_window = NULL;
|
||||
static SDL_Renderer* g_renderer = NULL;
|
||||
@@ -9,6 +11,10 @@ static SDL_Texture* g_wall_texture = NULL;
|
||||
|
||||
lean_obj_res sdl_init(uint32_t flags, lean_obj_arg w) {
|
||||
int32_t result = SDL_Init(flags);
|
||||
if (!result) {
|
||||
const char* err = SDL_GetError();
|
||||
printf("Error initializing SDL %d : %s\n", result, err);
|
||||
}
|
||||
return lean_io_result_mk_ok(lean_box_uint32(result));
|
||||
}
|
||||
|
||||
@@ -132,4 +138,4 @@ lean_obj_res sdl_render_texture_column(uint32_t dst_x, uint32_t dst_y, uint32_t
|
||||
SDL_FRect dst_rect = {(float)dst_x, (float)dst_y, 1.0f, (float)dst_height};
|
||||
|
||||
return lean_io_result_mk_ok(lean_box_uint32(SDL_RenderTexture(g_renderer, g_wall_texture, &src_rect, &dst_rect)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user