From fcfea1b65d012ee45f6b35a4b822ba0e20ccbbe0 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Mon, 11 Dec 2017 03:07:27 +1100 Subject: [PATCH] [client] fixed basic renderer --- client/main.c | 2 +- client/renderers/basic.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/client/main.c b/client/main.c index 8fb100cb..63bf455d 100644 --- a/client/main.c +++ b/client/main.c @@ -271,7 +271,7 @@ int renderThread(void * unused) { if (!IS_LG_RENDERER_VALID(*r)) { - DEBUG_ERROR("FIXME: Renderer %d is invalid, skpping", (int)(r - &LG_Renderers[0])); + DEBUG_ERROR("FIXME: Renderer %d is invalid, skipping", (int)(r - &LG_Renderers[0])); continue; } diff --git a/client/renderers/basic.c b/client/renderers/basic.c index 11f9153f..3f89b087 100644 --- a/client/renderers/basic.c +++ b/client/renderers/basic.c @@ -110,6 +110,13 @@ bool lgr_basic_is_compatible(void * opaque, const LG_RendererFormat format) return (memcmp(&this->format, &format, sizeof(LG_RendererFormat)) == 0); } +void lgr_basic_on_resize(void * opaque, const int width, const int height) +{ + const struct LGR_Basic * this = (struct LGR_Basic *)opaque; + if (!this || !this->initialized) + return; +} + bool lgr_basic_render(void * opaque, const LG_RendererRect destRect, const uint8_t * data, bool resample) { struct LGR_Basic * this = (struct LGR_Basic *)opaque; @@ -145,6 +152,7 @@ bool lgr_basic_render(void * opaque, const LG_RendererRect destRect, const uint8 SDL_UnlockTexture(this->texture); SDL_RenderCopy(this->renderer, this->texture, NULL, &rect); + SDL_RenderPresent(this->renderer); return true; } @@ -155,5 +163,6 @@ const LG_Renderer LGR_Basic = .initialize = lgr_basic_initialize, .deinitialize = lgr_basic_deinitialize, .is_compatible = lgr_basic_is_compatible, + .on_resize = lgr_basic_on_resize, .render = lgr_basic_render }; \ No newline at end of file