summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile22
-rw-r--r--stdlibsock/gfx/crtwin.c8
3 files changed, 20 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index 5761abc..fcc8d94 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
*.o
+luma.elf
diff --git a/Makefile b/Makefile
index 3e13985..2904491 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,19 @@
CC=clang
-CCFLAGS+=-Iinclude -std=c2x -Wall -Wextra -Wpedantic -Werror
-CCFLAGS+=-O2
+CFLAGS+=-Iinclude -std=c2x -Wall -Wextra -Wpedantic -Werror
+CFLAGS+=-O2
LIBS=-lgmp -lmpfr -lxcb -lvulkan
-SRC=\
- include/luma/stdlibsock.h \
+HDR=\
include/luma/stdlibsock/gfx.h \
- main.c \
+ include/luma/main.h \
+ include/luma/stdlibsock.h
+SRC=\
stdlibsock/gfx/crtwin.c \
- stdlibsock/gfx/destwin.c
-luma-testa: Makefile $(SRC)
- $(CC) $(CCFLAGS) $(LIBS) $(SRC)
+ stdlibsock/gfx/destwin.c \
+ main.c
+OBJ=$(SRC:.c=.o)
+luma.elf: $(OBJ)
+ $(CC) $(CCFLAGS) $(LIBS) $(OBJ) -o $@
+$(OBJ): $(HDR) $(SRC)
.PHONY: clean
clean:
- rm luma *.gch
+ rm $(OBJ)
diff --git a/stdlibsock/gfx/crtwin.c b/stdlibsock/gfx/crtwin.c
index 1079c63..b50daa5 100644
--- a/stdlibsock/gfx/crtwin.c
+++ b/stdlibsock/gfx/crtwin.c
@@ -1,10 +1,14 @@
# include <luma/main.h>
# include <stdint.h>
+# include <stdio.h>
# include <string.h>
# include <unistd.h>
# include <xcb/xcb.h>
# include <xcb/xcb_atom.h>
-uint8_t luma__stdlibsock__gfx__crtwin(char * nm,uint16_t pos_x,uint16_t pos_y,uint16_t res_x,uint16_t res_y,bool flscreen) {
+uint8_t luma__stdlibsock__gfx__crtwin(char * nm,uint16_t pos_x,uint16_t pos_y,uint16_t res_x,uint16_t res_y,bool flscrn) {
+ if(flscrn) {
+ printf("Fullscreen is not supported yet!\n");
+ }
xcb_connection_t * luma__dat__xcbconn;
xcb_screen_t * luma__dat__xcbscrn;
xcb_window_t luma__dat__xcbwin;
@@ -12,7 +16,7 @@ uint8_t luma__stdlibsock__gfx__crtwin(char * nm,uint16_t pos_x,uint16_t pos_y,ui
luma__dat__xcbscrn = xcb_setup_roots_iterator(xcb_get_setup(luma__dat__xcbconn)).data;
luma__dat__xcbwin = xcb_generate_id(luma__dat__xcbconn);
xcb_create_window(luma__dat__xcbconn,XCB_COPY_FROM_PARENT,luma__dat__xcbwin,luma__dat__xcbscrn->root,pos_y,pos_x,res_x,res_y,0xa,XCB_WINDOW_CLASS_INPUT_OUTPUT,luma__dat__xcbscrn->root_visual,0x0,NULL);
- xcb_change_property(luma__dat__xcbconn,XCB_PROP_MODE_REPLACE,luma__dat__xcbwin,XCB_ATOM_WM_NAME,XCB_ATOM_wSTRING,0x8,strlen(nm),nm);
+ xcb_change_property(luma__dat__xcbconn,XCB_PROP_MODE_REPLACE,luma__dat__xcbwin,XCB_ATOM_WM_NAME,XCB_ATOM_STRING,0x8,strlen(nm),nm);
xcb_map_window(luma__dat__xcbconn,luma__dat__xcbwin);
xcb_flush(luma__dat__xcbconn);
sleep(0x6);