INITIAL
Simple hello world in raylib, with a Makefile to do the compilation for me!
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
*.out
|
||||||
|
*.o
|
||||||
|
*.so
|
||||||
20
Makefile
Normal file
20
Makefile
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
CC=gcc
|
||||||
|
CFLAGS=-Wall -Wextra -pedantic -ggdb -fsanitize=address
|
||||||
|
LIBS=-lm -lraylib
|
||||||
|
OBJECTS=main.o
|
||||||
|
OUT=sandpile.out
|
||||||
|
ARGS=
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
$(CC) $(CFLAGS) -c $^ -o $@ $(LIBS)
|
||||||
|
|
||||||
|
$(OUT): $(OBJECTS)
|
||||||
|
$(CC) $(CFLAGS) $^ -o $@ $(LIBS)
|
||||||
|
|
||||||
|
.PHONY:
|
||||||
|
clean:
|
||||||
|
rm -rfv $(OUT) $(OBJECTS)
|
||||||
|
|
||||||
|
.PHONY: run
|
||||||
|
run: $(OUT)
|
||||||
|
./$^ $(ARGS)
|
||||||
26
main.c
Normal file
26
main.c
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
/* main.c
|
||||||
|
* Created: 2023-08-25
|
||||||
|
* Author: Aryadev Chavali
|
||||||
|
* Description: Entry point of program
|
||||||
|
*/
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <raylib.h>
|
||||||
|
|
||||||
|
#define WIDTH 512
|
||||||
|
#define HEIGHT 512
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
InitWindow(WIDTH, HEIGHT, "Abelian sand pile");
|
||||||
|
SetTargetFPS(60);
|
||||||
|
while (!WindowShouldClose())
|
||||||
|
{
|
||||||
|
BeginDrawing();
|
||||||
|
ClearBackground(BLACK);
|
||||||
|
DrawText("Hello, world!", 100, 100, 25, RAYWHITE);
|
||||||
|
EndDrawing();
|
||||||
|
}
|
||||||
|
CloseWindow();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user