yet another api rework, removal of integer types in public api, optionals at the end, some cleaning
This commit is contained in:
@ -37,8 +37,8 @@ static int event_callback(void *userdata, SDL_Event *event) {
|
||||
|
||||
switch (event->window.event) {
|
||||
case SDL_WINDOWEVENT_SIZE_CHANGED:
|
||||
ctx.window_dims.x = event->window.data1;
|
||||
ctx.window_dims.y = event->window.data2;
|
||||
ctx.window_dims.x = (float)event->window.data1;
|
||||
ctx.window_dims.y = (float)event->window.data2;
|
||||
ctx.resync_flag = true;
|
||||
break;
|
||||
|
||||
@ -444,7 +444,7 @@ static bool initialize(void) {
|
||||
goto fail;
|
||||
}
|
||||
ctx.base_render_width = datum_base_render_width.u.i;
|
||||
ctx.game.resolution.x = (int)ctx.base_render_width;
|
||||
ctx.game.resolution.x = (float)ctx.base_render_width;
|
||||
|
||||
toml_datum_t datum_base_render_height = toml_int_in(game, "base_render_height");
|
||||
if (!datum_base_render_height.ok) {
|
||||
@ -452,7 +452,7 @@ static bool initialize(void) {
|
||||
goto fail;
|
||||
}
|
||||
ctx.base_render_height = datum_base_render_height.u.i;
|
||||
ctx.game.resolution.y = (int)ctx.base_render_height;
|
||||
ctx.game.resolution.y = (float)ctx.base_render_height;
|
||||
|
||||
ctx.window = SDL_CreateWindow(datum_title.u.s,
|
||||
SDL_WINDOWPOS_CENTERED,
|
||||
@ -508,8 +508,8 @@ static bool initialize(void) {
|
||||
|
||||
/* TODO: */
|
||||
// SDL_GetRendererOutputSize(ctx.renderer, &ctx.window_w, &ctx.window_h);
|
||||
ctx.window_dims.x = (int)ctx.base_render_width;
|
||||
ctx.window_dims.y = (int)ctx.base_render_height;
|
||||
ctx.window_dims.x = (float)ctx.base_render_width;
|
||||
ctx.window_dims.y = (float)ctx.base_render_height;
|
||||
|
||||
/* add a watcher for immediate updates on window size */
|
||||
SDL_AddEventWatch(event_callback, NULL);
|
||||
|
Reference in New Issue
Block a user