Created
January 10, 2024 16:59
-
-
Save tusqasi/09ed7c5e8fbf96cd8a7628207f93e49d to your computer and use it in GitHub Desktop.
Raylib starting template for stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "raylib.h" | |
#include <stdlib.h> | |
#define WIDTH 1000 | |
#define HEIGHT 800 | |
#define FPS 120 | |
int main(void) { | |
InitWindow(WIDTH, HEIGHT, "raylib [core] example - basic window"); | |
SetTargetFPS(FPS); // Set our graphics to run at 60 frames-per-second | |
bool paused = false; | |
while (!WindowShouldClose()) { | |
int pressed_key = GetKeyPressed(); | |
paused = pressed_key == 32 ? !paused : paused; | |
if (paused) { | |
BeginDrawing(); | |
DrawText("PAUSED", 0, 0, 100, GREEN); | |
EndDrawing(); | |
continue; | |
} | |
BeginDrawing(); | |
ClearBackground(DARKGRAY); | |
// Draw stuff here, maybe.... | |
EndDrawing(); | |
} | |
CloseWindow(); | |
return EXIT_SUCCESS; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment