MCPcopy Create free account
hub / github.com/RobLoach/raylib-cpp / main

Function main

examples/core/core_basic_window.cpp:24–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22#include "raylib-cpp.hpp"
23
24int main() {
25 // Initialization
26 //--------------------------------------------------------------------------------------
27 int screenWidth = 800;
28 int screenHeight = 450;
29 raylib::Color textColor = raylib::Color::LightGray();
30 raylib::Window window(screenWidth, screenHeight, "raylib [core] example - basic window");
31
32 SetTargetFPS(60);
33 //--------------------------------------------------------------------------------------
34
35 // Main game loop
36 while (!window.ShouldClose()) { // Detect window close button or ESC key
37 // Update
38 //----------------------------------------------------------------------------------
39 // Update your variables here
40 //----------------------------------------------------------------------------------
41
42 // Draw
43 //----------------------------------------------------------------------------------
44 while (window.Drawing()) {
45 window.ClearBackground(RAYWHITE);
46 textColor.DrawText("Congrats! You created your first window!", 190, 200, 20);
47 }
48 //----------------------------------------------------------------------------------
49 }
50
51 return 0;
52}

Callers

nothing calls this directly

Calls 4

LightGrayFunction · 0.85
ShouldCloseMethod · 0.80
DrawingMethod · 0.80
DrawTextMethod · 0.80

Tested by

no test coverage detected