basic raylib boilerplate
This commit is contained in:
3
build.sh
3
build.sh
@@ -1,9 +1,10 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
CFLAGS="-Wall -Wextra -Wpedantic -Wswitch-enum -Werror -std=c23 -ggdb"
|
||||
LDFLAGS="-lm -lraylib"
|
||||
SRC="main.c"
|
||||
OUT="main.out"
|
||||
|
||||
set -xe
|
||||
|
||||
cc $CFLAGS -o $OUT $SRC;
|
||||
cc $CFLAGS -o $OUT $SRC $LDFLAGS;
|
||||
|
||||
15
main.c
15
main.c
@@ -4,11 +4,24 @@
|
||||
* License: See end of file
|
||||
*/
|
||||
|
||||
#include <raylib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define WIDTH 800
|
||||
#define HEIGHT 600
|
||||
|
||||
int main(void)
|
||||
{
|
||||
puts("Hello, world!");
|
||||
InitWindow(WIDTH, HEIGHT, "CompLife");
|
||||
SetTargetFPS(60);
|
||||
while (!WindowShouldClose())
|
||||
{
|
||||
BeginDrawing();
|
||||
ClearBackground(BLACK);
|
||||
DrawFPS(0, 0);
|
||||
EndDrawing();
|
||||
}
|
||||
CloseWindow();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user