|
|
@ -237,12 +237,11 @@ void ImGui_ImplSdl_NewFrame(SDL_Window *window) |
|
|
|
|
|
|
|
|
|
|
|
// Setup display size (every frame to accommodate for window resizing)
|
|
|
|
// Setup display size (every frame to accommodate for window resizing)
|
|
|
|
int w, h; |
|
|
|
int w, h; |
|
|
|
|
|
|
|
int display_w, display_h; |
|
|
|
SDL_GetWindowSize(window, &w, &h); |
|
|
|
SDL_GetWindowSize(window, &w, &h); |
|
|
|
|
|
|
|
SDL_GL_GetDrawableSize(window, &display_w, &display_h); |
|
|
|
io.DisplaySize = ImVec2((float)w, (float)h); |
|
|
|
io.DisplaySize = ImVec2((float)w, (float)h); |
|
|
|
|
|
|
|
io.DisplayFramebufferScale = ImVec2(w > 0 ? ((float)display_w / w) : 0, h > 0 ? ((float)display_h / h) : 0); |
|
|
|
int glW, glH; |
|
|
|
|
|
|
|
SDL_GL_GetDrawableSize(window, &glW, &glH); |
|
|
|
|
|
|
|
io.DisplayFramebufferScale = ImVec2(glW / io.DisplaySize.x, glH / io.DisplaySize.y); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Setup time step
|
|
|
|
// Setup time step
|
|
|
|
Uint32 time = SDL_GetTicks(); |
|
|
|
Uint32 time = SDL_GetTicks(); |
|
|
|