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