Skip to content

Commit

Permalink
Windows doesn't use SDL
Browse files Browse the repository at this point in the history
  • Loading branch information
louist103 committed Nov 11, 2024
1 parent 1ad9201 commit 69fc245
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ int main(int, char**)
bool show_demo_window = true;
bool show_another_window = false;
ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
float ddpi;
float hdpi;
float vdpi;
SDL_GetDisplayDPI(0, &ddpi, &hdpi, &vdpi);
ImGui::GetStyle().ScaleAllSizes(ddpi / 96.0f);

#if defined (_WIN32)
io.Fonts->AddFontFromFileTTF("assets/Roboto-Medium.ttf", 32.0f);
Expand Down Expand Up @@ -173,6 +168,12 @@ static int InitState() {
ImGui_ImplSDL2_InitForOpenGL(window, gl_context);
ImGui_ImplOpenGL3_Init(glsl_version);

float ddpi;
float hdpi;
float vdpi;
SDL_GetDisplayDPI(0, &ddpi, &hdpi, &vdpi);
ImGui::GetStyle().ScaleAllSizes(ddpi / 96.0f);

#elif defined(_WIN32)
// Create application window
//ImGui_ImplWin32_EnableDpiAwareness();
Expand Down

0 comments on commit 69fc245

Please sign in to comment.