From 9f7c3e94afb09d772f2659b98a4acfd82960c996 Mon Sep 17 00:00:00 2001 From: qiekn Date: Sat, 30 Aug 2025 21:25:25 +0800 Subject: [PATCH] Fix examples high-dpi (#506) --- examples/animation_curve/animation_curve.c | 2 ++ examples/controls_test_suite/controls_test_suite.c | 2 ++ examples/controls_test_suite/gui_value_box_float.c | 2 ++ examples/custom_file_dialog/custom_file_dialog.c | 2 ++ examples/custom_input_box/custom_input_box.c | 2 ++ examples/custom_sliders/custom_sliders.c | 2 ++ examples/floating_window/floating_window.c | 2 ++ examples/image_exporter/image_exporter.c | 2 ++ examples/image_importer_raw/image_importer_raw.c | 2 ++ examples/portable_window/portable_window.c | 3 ++- examples/property_list/property_list.c | 2 ++ examples/scroll_panel/scroll_panel.c | 2 ++ examples/style_selector/style_selector.c | 2 ++ 13 files changed, 26 insertions(+), 1 deletion(-) diff --git a/examples/animation_curve/animation_curve.c b/examples/animation_curve/animation_curve.c index 2f9b2f04..1c86ddaa 100644 --- a/examples/animation_curve/animation_curve.c +++ b/examples/animation_curve/animation_curve.c @@ -49,6 +49,8 @@ int main() const int screenWidth = 800; const int screenHeight = 540; + SetConfigFlags(FLAG_WINDOW_HIGHDPI); + InitWindow(screenWidth, screenHeight, "raygui - animation curves"); SetTargetFPS(60); diff --git a/examples/controls_test_suite/controls_test_suite.c b/examples/controls_test_suite/controls_test_suite.c index 9bf057af..7cfb4c55 100644 --- a/examples/controls_test_suite/controls_test_suite.c +++ b/examples/controls_test_suite/controls_test_suite.c @@ -67,6 +67,8 @@ int main() const int screenWidth = 960; const int screenHeight = 560; + SetConfigFlags(FLAG_WINDOW_HIGHDPI); + InitWindow(screenWidth, screenHeight, "raygui - controls test suite"); SetExitKey(0); diff --git a/examples/controls_test_suite/gui_value_box_float.c b/examples/controls_test_suite/gui_value_box_float.c index 87193759..02d693ea 100644 --- a/examples/controls_test_suite/gui_value_box_float.c +++ b/examples/controls_test_suite/gui_value_box_float.c @@ -28,6 +28,8 @@ int main() const int screenWidth = 800; const int screenHeight = 450; + SetConfigFlags(FLAG_WINDOW_HIGHDPI); + InitWindow(screenWidth, screenHeight, "raygui - controls test suite"); float valueBoxValue = 0.0f; diff --git a/examples/custom_file_dialog/custom_file_dialog.c b/examples/custom_file_dialog/custom_file_dialog.c index dea4f231..d15303a2 100644 --- a/examples/custom_file_dialog/custom_file_dialog.c +++ b/examples/custom_file_dialog/custom_file_dialog.c @@ -35,6 +35,8 @@ int main() int screenWidth = 800; int screenHeight = 560; + SetConfigFlags(FLAG_WINDOW_HIGHDPI); + InitWindow(screenWidth, screenHeight, "raygui - custom modal dialog"); SetExitKey(0); diff --git a/examples/custom_input_box/custom_input_box.c b/examples/custom_input_box/custom_input_box.c index 18b7ffcf..b452e837 100644 --- a/examples/custom_input_box/custom_input_box.c +++ b/examples/custom_input_box/custom_input_box.c @@ -22,6 +22,8 @@ int GuiFloatBox(Rectangle bounds, const char* text, float* value, int minValue, int main() { + SetConfigFlags(FLAG_WINDOW_HIGHDPI); + InitWindow(250, 100, "Basic calculator"); // General variables diff --git a/examples/custom_sliders/custom_sliders.c b/examples/custom_sliders/custom_sliders.c index ecd7e27b..d74f72f5 100644 --- a/examples/custom_sliders/custom_sliders.c +++ b/examples/custom_sliders/custom_sliders.c @@ -45,6 +45,8 @@ int main() int screenWidth = 800; int screenHeight = 450; + SetConfigFlags(FLAG_WINDOW_HIGHDPI); + InitWindow(screenWidth, screenHeight, "raygui - custom sliders"); float value = 0.5f; diff --git a/examples/floating_window/floating_window.c b/examples/floating_window/floating_window.c index df6bc311..21c17c6d 100644 --- a/examples/floating_window/floating_window.c +++ b/examples/floating_window/floating_window.c @@ -130,6 +130,8 @@ static void DrawContent(Vector2 position, Vector2 scroll) { } int main(void) { + SetConfigFlags(FLAG_WINDOW_HIGHDPI); + InitWindow(960, 560, "raygui - floating window example"); SetTargetFPS(60); GuiLoadStyleDark(); diff --git a/examples/image_exporter/image_exporter.c b/examples/image_exporter/image_exporter.c index cf5cd580..07a46bf4 100644 --- a/examples/image_exporter/image_exporter.c +++ b/examples/image_exporter/image_exporter.c @@ -30,6 +30,8 @@ int main(int argc, char *argv[]) const int screenWidth = 800; const int screenHeight = 450; + SetConfigFlags(FLAG_WINDOW_HIGHDPI); + InitWindow(screenWidth, screenHeight, "raygui - image exporter"); // GUI controls initialization diff --git a/examples/image_importer_raw/image_importer_raw.c b/examples/image_importer_raw/image_importer_raw.c index 4f860820..ea7affae 100644 --- a/examples/image_importer_raw/image_importer_raw.c +++ b/examples/image_importer_raw/image_importer_raw.c @@ -34,6 +34,8 @@ int main() const int screenWidth = 800; const int screenHeight = 600; + SetConfigFlags(FLAG_WINDOW_HIGHDPI); + InitWindow(screenWidth, screenHeight, "raygui - image raw importer"); Texture2D texture = { 0 }; diff --git a/examples/portable_window/portable_window.c b/examples/portable_window/portable_window.c index a7d3c9aa..6032b789 100644 --- a/examples/portable_window/portable_window.c +++ b/examples/portable_window/portable_window.c @@ -30,7 +30,8 @@ int main() const int screenWidth = 800; const int screenHeight = 600; - SetConfigFlags(FLAG_WINDOW_UNDECORATED); + SetConfigFlags(FLAG_WINDOW_UNDECORATED | FLAG_WINDOW_HIGHDPI); + InitWindow(screenWidth, screenHeight, "raygui - portable window"); // General variables diff --git a/examples/property_list/property_list.c b/examples/property_list/property_list.c index 64957c36..baea87b3 100644 --- a/examples/property_list/property_list.c +++ b/examples/property_list/property_list.c @@ -37,6 +37,8 @@ int main() const int screenWidth = 800; const int screenHeight = 450; + SetConfigFlags(FLAG_WINDOW_HIGHDPI); + InitWindow(screenWidth, screenHeight, "raygui - property list"); GuiDMProperty prop[] = { diff --git a/examples/scroll_panel/scroll_panel.c b/examples/scroll_panel/scroll_panel.c index 9c2ae1f3..9a5291ad 100644 --- a/examples/scroll_panel/scroll_panel.c +++ b/examples/scroll_panel/scroll_panel.c @@ -39,6 +39,8 @@ int main() const int screenWidth = 800; const int screenHeight = 450; + SetConfigFlags(FLAG_WINDOW_HIGHDPI); + InitWindow(screenWidth, screenHeight, "raygui - GuiScrollPanel()"); Rectangle panelRec = { 20, 40, 200, 150 }; diff --git a/examples/style_selector/style_selector.c b/examples/style_selector/style_selector.c index b4afe669..819a609f 100644 --- a/examples/style_selector/style_selector.c +++ b/examples/style_selector/style_selector.c @@ -49,6 +49,8 @@ int main() const int screenWidth = 800; const int screenHeight = 480; + SetConfigFlags(FLAG_WINDOW_HIGHDPI); + InitWindow(screenWidth, screenHeight, "raygui - styles selector"); SetExitKey(0);