summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2022-10-07 20:34:48 +0200
committerxengineering <me@xengineering.eu>2022-10-07 20:40:51 +0200
commitb726bd936ce416044d447ce81409dcc0a9d9aaae (patch)
tree91f9bcad8bad2f4f75bfb800f3b542641aeb00b0
parent59af37ca75ddbdcf639f8eadadeb8253ff9b0a50 (diff)
downloadlimox-b726bd936ce416044d447ce81409dcc0a9d9aaae.tar
limox-b726bd936ce416044d447ce81409dcc0a9d9aaae.tar.zst
limox-b726bd936ce416044d447ce81409dcc0a9d9aaae.zip
Implement first GUI demonstration with SDL
-rw-r--r--meson.build2
-rw-r--r--sdl.c15
2 files changed, 16 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 4b57931..9a5f339 100644
--- a/meson.build
+++ b/meson.build
@@ -1,6 +1,6 @@
project('LimoX', 'c')
gtkdep = dependency('gtk4')
strophedep = dependency('libstrophe')
-sdldep = dependency('sdl2')
+sdldep = dependency('sdl')
executable('limox', ['main.c', 'gtk.c', 'net.c', 'data.c'], dependencies : [gtkdep, strophedep])
executable('limox_sdl', ['main.c', 'sdl.c', 'net.c', 'data.c'], dependencies : [sdldep, strophedep])
diff --git a/sdl.c b/sdl.c
index c17e0f8..fcc9581 100644
--- a/sdl.c
+++ b/sdl.c
@@ -1,11 +1,26 @@
+#include <SDL/SDL.h>
+
#include "net.h"
#include "data.h"
void gui_run(void) {
+ int cont = 1;
+ SDL_Event event;
+
+ SDL_Init(SDL_INIT_EVERYTHING);
+ SDL_WM_SetCaption("LimoX", NULL);
+ SDL_SetVideoMode(800, 600, 32, SDL_HWSURFACE);
+ while (cont) {
+ SDL_WaitEvent(&event);
+ if (event.type == SDL_QUIT)
+ cont = 0;
+ }
+ SDL_Quit();
+
}
void gui_connected(char* jid, char* password) {