ImGuiStyle_ScaleAllSizes(style,main_scale);// Bake a fixed style scale. (until we have a solution for dynamic style scaling, changing this requires resetting Style + calling this again)
style->FontScaleDpi=main_scale;// Set initial font scale. (using io.ConfigDpiScaleFonts=true makes this unnecessary. We leave both here for documentation purpose)
io->ConfigDpiScaleFonts=true;// [Experimental] Automatically overwrite style.FontScaleDpi in Begin() when Monitor DPI changes. This will scale fonts but _NOT_ scale sizes/padding for now.
io->ConfigDpiScaleViewports=true;// [Experimental] Scale Dear ImGui and Platform Windows when Monitor DPI changes.
// Poll and handle events (inputs, window resize, etc.)
// You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
// - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application, or clear/overwrite your copy of the mouse data.
// - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application, or clear/overwrite your copy of the keyboard data.
// Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
// [If using SDL_MAIN_USE_CALLBACKS: call ImGui_ImplSDL3_ProcessEvent() from your SDL_AppEvent() function]
igSliderFloat("float",&f,0.0f,1.0f,"%.3f",0);// Edit 1 float using a slider from 0.0f to 1.0f
igColorEdit4("clear color",(float*)&clear_color,0);// Edit 3 floats representing a color
ImVec2buttonSize;
buttonSize.x=0;
buttonSize.y=0;
if(igButton("Button",buttonSize))// Buttons return true when clicked (most widgets return true when edited/activated)
counter++;
igSameLine(0.0f,-1.0f);
igText("counter = %d",counter);
igText("Application average %.3f ms/frame (%.1f FPS)",1000.0f/io->Framerate,io->Framerate);
igEnd();
}
// 3. Show another simple window.
if(show_another_window)
{
igBegin("Another Window",&show_another_window,0);// Pass a pointer to our bool variable (the window will have a closing button that will clear the bool when clicked)