mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-28 01:20:55 +01:00
Automatically updating DisplayFrameBufferScale by reading the OpenGL drawable size and comparing with the window size. This fixed dear imgui which was rendering only to 1/4 of my window.
This commit is contained in:
parent
aecf5d12e6
commit
a9b0abe493
@ -240,6 +240,10 @@ void ImGui_ImplSdl_NewFrame(SDL_Window *window)
|
||||
SDL_GetWindowSize(window, &w, &h);
|
||||
io.DisplaySize = ImVec2((float)w, (float)h);
|
||||
|
||||
int glW, glH;
|
||||
SDL_GL_GetDrawableSize(window, &glW, &glH);
|
||||
io.DisplayFramebufferScale = ImVec2(glW / io.DisplaySize.x, glH / io.DisplaySize.y);
|
||||
|
||||
// Setup time step
|
||||
Uint32 time = SDL_GetTicks();
|
||||
double current_time = time / 1000.0;
|
||||
|
Loading…
Reference in New Issue
Block a user