| 12 | #include "raylib-cpp.hpp" |
| 13 | |
| 14 | int main() { |
| 15 | // Initialization |
| 16 | //-------------------------------------------------------------------------------------- |
| 17 | const int screenWidth = 800; |
| 18 | const int screenHeight = 450; |
| 19 | |
| 20 | raylib::Window window(screenWidth, screenHeight, "raylib [shapes] example - raylib logo using shapes"); |
| 21 | raylib::Color foreground(0, 68, 130); |
| 22 | raylib::Color background = RAYWHITE; |
| 23 | |
| 24 | SetTargetFPS(60); // Set our game to run at 60 frames-per-second |
| 25 | //-------------------------------------------------------------------------------------- |
| 26 | |
| 27 | // Main game loop |
| 28 | while (!window.ShouldClose()) { // Detect window close button or ESC key |
| 29 | // Update |
| 30 | //---------------------------------------------------------------------------------- |
| 31 | // Update your variables here |
| 32 | //---------------------------------------------------------------------------------- |
| 33 | |
| 34 | // Draw |
| 35 | //---------------------------------------------------------------------------------- |
| 36 | BeginDrawing(); |
| 37 | { |
| 38 | window.ClearBackground(background); |
| 39 | |
| 40 | foreground.DrawRectangle(screenWidth/2 - 128, screenHeight/2 - 128, 256, 256); |
| 41 | background.DrawRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224); |
| 42 | foreground.DrawText("raylib", screenWidth/2 - 44, screenHeight/2 + 24, 50); |
| 43 | foreground.DrawText("cpp", screenWidth/2 - 74, screenHeight/2 + 54, 50); |
| 44 | |
| 45 | DrawText("this is NOT a texture!", 350, 370, 10, GRAY); |
| 46 | } |
| 47 | EndDrawing(); |
| 48 | //---------------------------------------------------------------------------------- |
| 49 | } |
| 50 | |
| 51 | return 0; |
| 52 | } |
nothing calls this directly
no test coverage detected