Skip to content

Commit

Permalink
Update high DPI handling
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinHelmut committed Jul 14, 2024
1 parent 6d2aad5 commit b0a7cf1
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 19 deletions.
5 changes: 4 additions & 1 deletion src/core/Core/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,12 @@ ExitStatus App::Application::run() {
// Rendering
ImGui::Render();

SDL_RenderSetScale(m_window->get_native_renderer(),
io.DisplayFramebufferScale.x,
io.DisplayFramebufferScale.y);
SDL_SetRenderDrawColor(m_window->get_native_renderer(), 100, 100, 100, 255);
SDL_RenderClear(m_window->get_native_renderer());
ImGui_ImplSDLRenderer2_RenderDrawData(ImGui::GetDrawData());
ImGui_ImplSDLRenderer2_RenderDrawData(ImGui::GetDrawData(), m_window->get_native_renderer());
SDL_RenderPresent(m_window->get_native_renderer());
}

Expand Down
1 change: 0 additions & 1 deletion src/core/Core/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ Window::Window(const Settings& settings) {

SDL_RendererInfo info;
SDL_GetRendererInfo(m_renderer, &info);
DPIHandler::set_render_scale(m_renderer);

APP_DEBUG("Current SDL_Renderer: {}", info.name);
}
Expand Down
5 changes: 0 additions & 5 deletions src/core/Platform/Linux/DPIHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ WindowSize DPIHandler::get_dpi_aware_window_size(const Window::Settings& setting
return {settings.width, settings.height};
}

void DPIHandler::set_render_scale([[maybe_unused]] SDL_Renderer* renderer) {
APP_PROFILE_FUNCTION();
// do nothing
}

void DPIHandler::set_global_font_scaling([[maybe_unused]] ImGuiIO* io) {
APP_PROFILE_FUNCTION();
// do nothing
Expand Down
7 changes: 0 additions & 7 deletions src/core/Platform/Mac/DPIHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ WindowSize DPIHandler::get_dpi_aware_window_size(const Window::Settings& setting
return {settings.width, settings.height};
}

void DPIHandler::set_render_scale(SDL_Renderer* renderer) {
APP_PROFILE_FUNCTION();

auto scale{get_scale()};
SDL_RenderSetScale(renderer, scale, scale);
}

void DPIHandler::set_global_font_scaling(ImGuiIO* io) {
APP_PROFILE_FUNCTION();

Expand Down
5 changes: 0 additions & 5 deletions src/core/Platform/Windows/DPIHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ WindowSize DPIHandler::get_dpi_aware_window_size(const Window::Settings& setting
return {width, height};
}

void DPIHandler::set_render_scale([[maybe_unused]] SDL_Renderer* renderer) {
APP_PROFILE_FUNCTION();
// do nothing
}

void DPIHandler::set_global_font_scaling([[maybe_unused]] ImGuiIO* io) {
APP_PROFILE_FUNCTION();
// do nothing
Expand Down

0 comments on commit b0a7cf1

Please sign in to comment.