This commit is contained in:
InventorXtreme 2023-12-02 02:49:06 -05:00
parent 44a6097e16
commit ed3acb7ff7
2 changed files with 39 additions and 0 deletions

12
Makefile Normal file
View file

@ -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

27
c3d.c Normal file
View file

@ -0,0 +1,27 @@
#include <stdio.h>
#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;
}