Commit 3566f640 authored by Nicholas Walton's avatar Nicholas Walton

Updated kero libs for SDL code path fix

parent a0d368af
......@@ -150,7 +150,7 @@ typedef struct {
bool K3D_LoadTexture(GLuint *texture_id, const char *const filepath) {
kimage_t image;
if(KILoadHardwareDefaults(&image, filepath) != KILOAD_SUCCESS) {
if(KI_LoadHardwareDefaults(&image, filepath) != KI_LOAD_SUCCESS) {
fprintf(stderr, "Failed to load texture: %s\n", filepath);
return false;
}
......@@ -164,7 +164,7 @@ bool K3D_LoadTexture(GLuint *texture_id, const char *const filepath) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.w, image.h, 0, GL_RGBA, GL_UNSIGNED_BYTE, image.pixels);
KIFree(&image);
KI_Free(&image);
return true;
}
......
......@@ -75,7 +75,7 @@ extern "C"{
SDL_Surface* canvas;
uint32_t frame_start;
uint32_t frame_finish;
const uint8_t* kp_keyboard;
const uint8_t* keyboard;
#endif
} kero_platform_t;
......@@ -700,12 +700,12 @@ Key repeats (holding key down) are ignored automatically.
}
// fps = 0 to disable frame limiting
void KP_SetTargetFramerate(const unsigned int fps) {
void KP_SetTargetFramerate(kero_platform_t *platform, const unsigned int fps) {
if(fps) {
target_frame_time = 1000/fps;
platform->target_frame_time = 1000/fps;
}
else{
target_frame_time = 0;
platform->target_frame_time = 0;
}
}
......@@ -729,7 +729,7 @@ Key repeats (holding key down) are ignored automatically.
platform->frame_buffer.h = platform->window.h;
platform->frame_buffer.pixels = (uint32_t*)platform->canvas->pixels;
platform->keyboard = SDL_GetKeyboardState(NULL);
KP_SetTargetFramerate(60);
KP_SetTargetFramerate(platform, 60);
platform->frame_start = SDL_GetTicks();
}
......@@ -833,7 +833,7 @@ Key repeats (holding key down) are ignored automatically.
event->height = platform->window.h;
SDL_FreeSurface(platform->canvas);
platform->canvas = SDL_GetWindowSurface(platform->sdlwindow);
platform->frame_buffer.pixels = canvas->pixels;
platform->frame_buffer.pixels = platform->canvas->pixels;
platform->frame_buffer.w = platform->window.w;
platform->frame_buffer.h = platform->window.h;
}break;
......@@ -855,7 +855,7 @@ Key repeats (holding key down) are ignored automatically.
free(e);
}
void KP_ShowCursor(const bool show) {
void KP_ShowCursor(kero_platform_t *platform, const bool show) {
SDL_ShowCursor(show);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment