mirror of
https://github.com/ocornut/imgui.git
synced 2025-10-26 12:27:30 +00:00
Examples: SDL3: specify SDL_WINDOW_HIGH_PIXEL_DENSITY and make centering consistent + call SDL_RenderScale().
This commit is contained in:
@@ -32,7 +32,7 @@ int main(int, char**)
|
||||
}
|
||||
|
||||
// Create window with SDL_Renderer graphics context
|
||||
Uint32 window_flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIDDEN;
|
||||
SDL_WindowFlags window_flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIDDEN | SDL_WINDOW_HIGH_PIXEL_DENSITY;
|
||||
SDL_Window* window = SDL_CreateWindow("Dear ImGui SDL3+SDL_Renderer example", 1280, 720, window_flags);
|
||||
if (window == nullptr)
|
||||
{
|
||||
@@ -164,7 +164,7 @@ int main(int, char**)
|
||||
|
||||
// Rendering
|
||||
ImGui::Render();
|
||||
//SDL_RenderSetScale(renderer, io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y);
|
||||
SDL_SetRenderScale(renderer, io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y);
|
||||
SDL_SetRenderDrawColorFloat(renderer, clear_color.x, clear_color.y, clear_color.z, clear_color.w);
|
||||
SDL_RenderClear(renderer);
|
||||
ImGui_ImplSDLRenderer3_RenderDrawData(ImGui::GetDrawData(), renderer);
|
||||
|
||||
Reference in New Issue
Block a user