diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b4f516c --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +CC = gcc +CFLAGS = -g +LDLIBS = -lraylib + +objects = c3d.o vec.o + +c3d: $(objects) + +$(objects): %.o: %.c + +clean: + rm -f *.o c3d diff --git a/c3d.c b/c3d.c new file mode 100644 index 0000000..2fd2835 --- /dev/null +++ b/c3d.c @@ -0,0 +1,27 @@ +#include +#include "raylib.h" + +int main() { + SetConfigFlags(FLAG_WINDOW_UNDECORATED); + InitWindow(800, 450, "raylib [core] example - basic window"); + + // SetWindowPosition(0,1080); + Vector2 a = GetMonitorPosition(0); + int mh = GetMonitorHeight(0); + int mw = GetMonitorWidth(0); + int w = 800; + int h = 450; + printf("mh:%d mw:%d w:%d h:%d\n", mh, mw, w, h); + SetWindowPosition(a.x + (0.5 * mw) - (w / 2), a.y + (0.5 * mh) - (0.5 * h)); + while (!WindowShouldClose()) { + BeginDrawing(); + ClearBackground(RAYWHITE); + DrawText("Congrats! You created your first window!", 190, 200, 20, + LIGHTGRAY); + EndDrawing(); + } + + CloseWindow(); + + return 0; +}