Update core_window_flags.c
This commit is contained in:
parent
d1119816d7
commit
1c9726fd8c
1 changed files with 73 additions and 73 deletions
|
@ -26,20 +26,20 @@ int main(void)
|
||||||
FLAG_WINDOW_UNDECORATED
|
FLAG_WINDOW_UNDECORATED
|
||||||
FLAG_WINDOW_TRANSPARENT
|
FLAG_WINDOW_TRANSPARENT
|
||||||
FLAG_WINDOW_HIDDEN
|
FLAG_WINDOW_HIDDEN
|
||||||
FLAG_WINDOW_MINIMIZED -> not working properly -> Support it on window creation?
|
FLAG_WINDOW_MINIMIZED -> Not supported on window creation
|
||||||
FLAG_WINDOW_MAXIMIZED -> not working properly -> Support it on window creation?
|
FLAG_WINDOW_MAXIMIZED -> Not supported on window creation
|
||||||
FLAG_WINDOW_UNFOCUSED
|
FLAG_WINDOW_UNFOCUSED
|
||||||
FLAG_WINDOW_TOPMOST
|
FLAG_WINDOW_TOPMOST
|
||||||
FLAG_WINDOW_HIGHDPI -> errors after minimize-resize, fb size is recalculated
|
FLAG_WINDOW_HIGHDPI -> errors after minimize-resize, fb size is recalculated
|
||||||
FLAG_WINDOW_ALWAYS_RUN -> not working?
|
FLAG_WINDOW_ALWAYS_RUN
|
||||||
FLAG_MSAA_4X_HINT
|
FLAG_MSAA_4X_HINT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Set configuration flags for window creation
|
// Set configuration flags for window creation
|
||||||
SetConfigFlags(FLAG_VSYNC_HINT | FLAG_MSAA_4X_HINT | FLAG_WINDOW_HIGHDPI | FLAG_WINDOW_ALWAYS_RUN);
|
SetConfigFlags(FLAG_VSYNC_HINT | FLAG_MSAA_4X_HINT | FLAG_WINDOW_HIGHDPI);
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [core] example - window flags");
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - window flags");
|
||||||
|
|
||||||
Vector2 ballPosition = { GetScreenWidth()/2, GetScreenHeight()/2 };
|
Vector2 ballPosition = { GetScreenWidth() / 2, GetScreenHeight() / 2 };
|
||||||
Vector2 ballSpeed = { 5.0f, 4.0f };
|
Vector2 ballSpeed = { 5.0f, 4.0f };
|
||||||
int ballRadius = 20;
|
int ballRadius = 20;
|
||||||
|
|
||||||
|
@ -135,48 +135,48 @@ int main(void)
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
BeginDrawing();
|
BeginDrawing();
|
||||||
|
|
||||||
if (IsWindowState(FLAG_WINDOW_TRANSPARENT)) ClearBackground(BLANK);
|
if (IsWindowState(FLAG_WINDOW_TRANSPARENT)) ClearBackground(BLANK);
|
||||||
else ClearBackground(RAYWHITE);
|
else ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
DrawCircleV(ballPosition, ballRadius, MAROON);
|
DrawCircleV(ballPosition, ballRadius, MAROON);
|
||||||
DrawRectangleLinesEx((Rectangle){ 0, 0, GetScreenWidth(), GetScreenHeight() }, 4, RAYWHITE);
|
DrawRectangleLinesEx((Rectangle) { 0, 0, GetScreenWidth(), GetScreenHeight() }, 4, RAYWHITE);
|
||||||
|
|
||||||
DrawCircleV(GetMousePosition(), 10, DARKBLUE);
|
DrawCircleV(GetMousePosition(), 10, DARKBLUE);
|
||||||
|
|
||||||
DrawFPS(10, 10);
|
DrawFPS(10, 10);
|
||||||
|
|
||||||
DrawText(FormatText("Screen Size: [%i, %i]", GetScreenWidth(), GetScreenHeight()), 10, 40, 10, GREEN);
|
DrawText(FormatText("Screen Size: [%i, %i]", GetScreenWidth(), GetScreenHeight()), 10, 40, 10, GREEN);
|
||||||
|
|
||||||
// Draw window state info
|
// Draw window state info
|
||||||
DrawText("Following flags can set after window creation:", 10, 60, 10, GRAY);
|
DrawText("Following flags can set after window creation:", 10, 60, 10, GRAY);
|
||||||
if (IsWindowState(FLAG_FULLSCREEN_MODE)) DrawText("[F] FLAG_FULLSCREEN_MODE: on", 10, 80, 10, LIME);
|
if (IsWindowState(FLAG_FULLSCREEN_MODE)) DrawText("[F] FLAG_FULLSCREEN_MODE: on", 10, 80, 10, LIME);
|
||||||
else DrawText("[F] FLAG_FULLSCREEN_MODE: off", 10, 80, 10, MAROON);
|
else DrawText("[F] FLAG_FULLSCREEN_MODE: off", 10, 80, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_RESIZABLE)) DrawText("[R] FLAG_WINDOW_RESIZABLE: on", 10, 100, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_RESIZABLE)) DrawText("[R] FLAG_WINDOW_RESIZABLE: on", 10, 100, 10, LIME);
|
||||||
else DrawText("[R] FLAG_WINDOW_RESIZABLE: off", 10, 100, 10, MAROON);
|
else DrawText("[R] FLAG_WINDOW_RESIZABLE: off", 10, 100, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_UNDECORATED)) DrawText("[D] FLAG_WINDOW_UNDECORATED: on", 10, 120, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_UNDECORATED)) DrawText("[D] FLAG_WINDOW_UNDECORATED: on", 10, 120, 10, LIME);
|
||||||
else DrawText("[D] FLAG_WINDOW_UNDECORATED: off", 10, 120, 10, MAROON);
|
else DrawText("[D] FLAG_WINDOW_UNDECORATED: off", 10, 120, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_HIDDEN)) DrawText("[H] FLAG_WINDOW_HIDDEN: on", 10, 140, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_HIDDEN)) DrawText("[H] FLAG_WINDOW_HIDDEN: on", 10, 140, 10, LIME);
|
||||||
else DrawText("[H] FLAG_WINDOW_HIDDEN: off", 10, 140, 10, MAROON);
|
else DrawText("[H] FLAG_WINDOW_HIDDEN: off", 10, 140, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_MINIMIZED)) DrawText("[N] FLAG_WINDOW_MINIMIZED: on", 10, 160, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_MINIMIZED)) DrawText("[N] FLAG_WINDOW_MINIMIZED: on", 10, 160, 10, LIME);
|
||||||
else DrawText("[N] FLAG_WINDOW_MINIMIZED: off", 10, 160, 10, MAROON);
|
else DrawText("[N] FLAG_WINDOW_MINIMIZED: off", 10, 160, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_MAXIMIZED)) DrawText("[M] FLAG_WINDOW_MAXIMIZED: on", 10, 180, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_MAXIMIZED)) DrawText("[M] FLAG_WINDOW_MAXIMIZED: on", 10, 180, 10, LIME);
|
||||||
else DrawText("[M] FLAG_WINDOW_MAXIMIZED: off", 10, 180, 10, MAROON);
|
else DrawText("[M] FLAG_WINDOW_MAXIMIZED: off", 10, 180, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_UNFOCUSED)) DrawText("[G] FLAG_WINDOW_UNFOCUSED: on", 10, 200, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_UNFOCUSED)) DrawText("[G] FLAG_WINDOW_UNFOCUSED: on", 10, 200, 10, LIME);
|
||||||
else DrawText("[U] FLAG_WINDOW_UNFOCUSED: off", 10, 200, 10, MAROON);
|
else DrawText("[U] FLAG_WINDOW_UNFOCUSED: off", 10, 200, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_TOPMOST)) DrawText("[T] FLAG_WINDOW_TOPMOST: on", 10, 220, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_TOPMOST)) DrawText("[T] FLAG_WINDOW_TOPMOST: on", 10, 220, 10, LIME);
|
||||||
else DrawText("[T] FLAG_WINDOW_TOPMOST: off", 10, 220, 10, MAROON);
|
else DrawText("[T] FLAG_WINDOW_TOPMOST: off", 10, 220, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_ALWAYS_RUN)) DrawText("[A] FLAG_WINDOW_ALWAYS_RUN: on", 10, 240, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_ALWAYS_RUN)) DrawText("[A] FLAG_WINDOW_ALWAYS_RUN: on", 10, 240, 10, LIME);
|
||||||
else DrawText("[A] FLAG_WINDOW_ALWAYS_RUN: off", 10, 240, 10, MAROON);
|
else DrawText("[A] FLAG_WINDOW_ALWAYS_RUN: off", 10, 240, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_VSYNC_HINT)) DrawText("[V] FLAG_VSYNC_HINT: on", 10, 260, 10, LIME);
|
if (IsWindowState(FLAG_VSYNC_HINT)) DrawText("[V] FLAG_VSYNC_HINT: on", 10, 260, 10, LIME);
|
||||||
else DrawText("[V] FLAG_VSYNC_HINT: off", 10, 260, 10, MAROON);
|
else DrawText("[V] FLAG_VSYNC_HINT: off", 10, 260, 10, MAROON);
|
||||||
|
|
||||||
DrawText("Following flags can only be set before window creation:", 10, 300, 10, GRAY);
|
DrawText("Following flags can only be set before window creation:", 10, 300, 10, GRAY);
|
||||||
if (IsWindowState(FLAG_WINDOW_HIGHDPI)) DrawText("FLAG_WINDOW_HIGHDPI: on", 10, 320, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_HIGHDPI)) DrawText("FLAG_WINDOW_HIGHDPI: on", 10, 320, 10, LIME);
|
||||||
else DrawText("FLAG_WINDOW_HIGHDPI: off", 10, 320, 10, MAROON);
|
else DrawText("FLAG_WINDOW_HIGHDPI: off", 10, 320, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_TRANSPARENT)) DrawText("FLAG_WINDOW_TRANSPARENT: on", 10, 340, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_TRANSPARENT)) DrawText("FLAG_WINDOW_TRANSPARENT: on", 10, 340, 10, LIME);
|
||||||
else DrawText("FLAG_WINDOW_TRANSPARENT: off", 10, 340, 10, MAROON);
|
else DrawText("FLAG_WINDOW_TRANSPARENT: off", 10, 340, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_MSAA_4X_HINT)) DrawText("FLAG_MSAA_4X_HINT: on", 10, 360, 10, LIME);
|
if (IsWindowState(FLAG_MSAA_4X_HINT)) DrawText("FLAG_MSAA_4X_HINT: on", 10, 360, 10, LIME);
|
||||||
else DrawText("FLAG_MSAA_4X_HINT: off", 10, 360, 10, MAROON);
|
else DrawText("FLAG_MSAA_4X_HINT: off", 10, 360, 10, MAROON);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue