| 1 | /******************************************************************************************* |
| 2 | * |
| 3 | * raylib [core] example - Basic window |
| 4 | * |
| 5 | * This example has been created using raylib 1.0 (www.raylib.com) |
| 6 | * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) |
| 7 | * |
| 8 | * Copyright (c) 2013-2024 Ramon Santamaria (@raysan5) |
| 9 | * |
| 10 | ********************************************************************************************/ |
| 11 | |
| 12 | #include "raylib.h" |
| 13 | |
| 14 | int main() |
| 15 | { |
| 16 | // Initialization |
| 17 | //-------------------------------------------------------------------------------------- |
| 18 | int screenWidth = 800; |
| 19 | int screenHeight = 450; |
| 20 | |
| 21 | InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window"); |
| 22 | |
| 23 | SetTargetFPS(60); |
| 24 | //-------------------------------------------------------------------------------------- |
| 25 | |
| 26 | // Main game loop |
| 27 | while (!WindowShouldClose()) // Detect window close button or ESC key |
| 28 | { |
| 29 | // Update |
| 30 | //---------------------------------------------------------------------------------- |
| 31 | // TODO: Update your variables here |
| 32 | //---------------------------------------------------------------------------------- |
| 33 | |
| 34 | // Draw |
| 35 | //---------------------------------------------------------------------------------- |
| 36 | BeginDrawing(); |
| 37 | |
| 38 | ClearBackground(RAYWHITE); |
| 39 | |
| 40 | DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); |
| 41 | |
| 42 | EndDrawing(); |
| 43 | //---------------------------------------------------------------------------------- |
| 44 | } |
| 45 | |
| 46 | // De-Initialization |
| 47 | //-------------------------------------------------------------------------------------- |
| 48 | CloseWindow(); // Close window and OpenGL context |
| 49 | //-------------------------------------------------------------------------------------- |
| 50 | |
| 51 | return 0; |
| 52 | } |