1 | /******************************************************************************************* |
2 | * |
3 | * raylib [shapes] example - Draw raylib logo using basic shapes |
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) 2014 Ramon Santamaria (@raysan5) |
9 | * |
10 | ********************************************************************************************/ |
11 | |
12 | #include "raylib.h" |
13 | |
14 | int main(void) |
15 | { |
16 | // Initialization |
17 | //-------------------------------------------------------------------------------------- |
18 | const int screenWidth = 800; |
19 | const int screenHeight = 450; |
20 | |
21 | InitWindow(screenWidth, screenHeight, "raylib [shapes] example - raylib logo using shapes" ); |
22 | |
23 | SetTargetFPS(60); // Set our game to run at 60 frames-per-second |
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 | DrawRectangle(screenWidth/2 - 128, screenHeight/2 - 128, 256, 256, BLACK); |
41 | DrawRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224, RAYWHITE); |
42 | DrawText("raylib" , screenWidth/2 - 44, screenHeight/2 + 48, 50, BLACK); |
43 | |
44 | DrawText("this is NOT a texture!" , 350, 370, 10, GRAY); |
45 | |
46 | EndDrawing(); |
47 | //---------------------------------------------------------------------------------- |
48 | } |
49 | |
50 | // De-Initialization |
51 | //-------------------------------------------------------------------------------------- |
52 | CloseWindow(); // Close window and OpenGL context |
53 | //-------------------------------------------------------------------------------------- |
54 | |
55 | return 0; |
56 | } |