chore: extracted logging output size to separate function
This commit is contained in:
parent
e7d11d4551
commit
7f3e831027
12
src/main.c
12
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);
|
||||
|
|
Loading…
Reference in a new issue