basic raylib boilerplate

This commit is contained in:
2026-03-09 07:19:01 +00:00
parent 2d75874423
commit c26e462429
2 changed files with 16 additions and 2 deletions

View File

@@ -1,9 +1,10 @@
#!/usr/bin/env sh #!/usr/bin/env sh
CFLAGS="-Wall -Wextra -Wpedantic -Wswitch-enum -Werror -std=c23 -ggdb" CFLAGS="-Wall -Wextra -Wpedantic -Wswitch-enum -Werror -std=c23 -ggdb"
LDFLAGS="-lm -lraylib"
SRC="main.c" SRC="main.c"
OUT="main.out" OUT="main.out"
set -xe set -xe
cc $CFLAGS -o $OUT $SRC; cc $CFLAGS -o $OUT $SRC $LDFLAGS;

15
main.c
View File

@@ -4,11 +4,24 @@
* License: See end of file * License: See end of file
*/ */
#include <raylib.h>
#include <stdio.h> #include <stdio.h>
#define WIDTH 800
#define HEIGHT 600
int main(void) int main(void)
{ {
puts("Hello, world!"); InitWindow(WIDTH, HEIGHT, "CompLife");
SetTargetFPS(60);
while (!WindowShouldClose())
{
BeginDrawing();
ClearBackground(BLACK);
DrawFPS(0, 0);
EndDrawing();
}
CloseWindow();
return 0; return 0;
} }