diff --git a/src/main.c b/src/main.c index a89542b..969351f 100644 --- a/src/main.c +++ b/src/main.c @@ -41,6 +41,13 @@ Clay_SDL3RendererData backendData = { .textEngine = nullptr }; +static inline +void LogOutputResolution() { + int w, h; + SDL_GetCurrentRenderOutputSize(renderer, &w, &h); + SDL_Log("output size: %i, %d", w, h); +} + static inline Clay_Dimensions MeasureText(Clay_StringSlice text, Clay_TextElementConfig *config, void *userData) { TTF_Font **fonts = userData; @@ -102,9 +109,7 @@ void InitSDL() { } SDL_SetRenderScale(renderer, 1.0/renderScale, 1.0/renderScale); InitFonts(); - int w, h; - SDL_GetCurrentRenderOutputSize(renderer, &w, &h); - SDL_Log("output size: %i, %d", w, h); + LogOutputResolution(); } static @@ -140,6 +145,7 @@ int main(int argc, char *argv[]) { event.window.data1 * (double)renderScale, event.window.data2 * (double)renderScale }); + LogOutputResolution(); break; case SDL_EVENT_MOUSE_WHEEL: Clay_UpdateScrollContainers(true, (Clay_Vector2){ event.wheel.x, event.wheel.y }, 0.01f);