Skip to content

Instantly share code, notes, and snippets.

@tusqasi
Created January 10, 2024 16:59
Show Gist options
  • Save tusqasi/09ed7c5e8fbf96cd8a7628207f93e49d to your computer and use it in GitHub Desktop.
Save tusqasi/09ed7c5e8fbf96cd8a7628207f93e49d to your computer and use it in GitHub Desktop.
Raylib starting template for stuff
#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