diff options
author | 2025-05-19 15:53:03 +0200 | |
---|---|---|
committer | 2025-05-19 15:53:03 +0200 | |
commit | bc803cb0a6d7095a45eec4413c55dd113c0eb659 (patch) | |
tree | bea48e6f9c0bbbe5fd97d31e54143327b85801c1 /src/main/engine/ui/x11 | |
parent | a20d8950d88bf89b2f9b8b02695fc464b2a13d01 (diff) | |
download | tris-bc803cb0a6d7095a45eec4413c55dd113c0eb659.tar.gz tris-bc803cb0a6d7095a45eec4413c55dd113c0eb659.zip |
Add the UI type
Diffstat (limited to 'src/main/engine/ui/x11')
-rw-r--r-- | src/main/engine/ui/x11/ui.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/engine/ui/x11/ui.c b/src/main/engine/ui/x11/ui.c index 2d1a046..89004c8 100644 --- a/src/main/engine/ui/x11/ui.c +++ b/src/main/engine/ui/x11/ui.c @@ -25,6 +25,7 @@ #include <unistd.h> #include <time.h> #include "../../../util.h" +#include "../ui.h" static Display *display; static Window window; @@ -92,9 +93,15 @@ ui_set_title(const char *title) XStoreName(display, window, title); } -void +UI * ui_init(int width, int height) { + UI *ui = malloc(sizeof(UI)); + if (ui == NULL) { + log_error("Error allocating UI"); + exit(1); + } + display = ui_open_display(); int screen = DefaultScreen(display); @@ -109,6 +116,11 @@ ui_init(int width, int height) log_error("Error on making GLX context"); exit(1); } + + ui->width = width; + ui->height = height; + + return ui; } static void |