mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-23 17:43:04 +00:00
Unfinished Wayland PR (#1)
moved from the github repo. current progress: <img width="389" alt="image.png" src="attachments/6a2cb365-7348-44b4-8fa7-9980df965a67"> Other notes: - took the opportunity to remove MwLLSetBackground which I was told was deprecated - Updated .gitignore to more accurately cover/remove example binaries - Uses OpenGL as the backend. - New LL function for swapping buffers, MwLLEndDraw - [TODO] Uses weak linking for all libraries so that systems that don't support Wayland or even have it installed can launch without it. Reviewed-on: https://gitea.nishi.boats/pyrite-dev/milsko/pulls/1 Co-authored-by: IoIxD <alphaproject217@gmail.com> Co-committed-by: IoIxD <alphaproject217@gmail.com>
This commit is contained in:
12
src/core.c
12
src/core.c
@@ -1,16 +1,20 @@
|
||||
#include <Mw/Milsko.h>
|
||||
|
||||
#include "../external/stb_ds.h"
|
||||
#include "Mw/LowLevel.h"
|
||||
|
||||
static void lldrawhandler(MwLL handle, void* data) {
|
||||
MwWidget h = (MwWidget)handle->common.user;
|
||||
|
||||
(void)data;
|
||||
MwLLBeginDraw(handle);
|
||||
|
||||
h->bgcolor = NULL;
|
||||
MwDispatch(h, draw);
|
||||
if(h->draw_inject != NULL) h->draw_inject(h);
|
||||
MwDispatchUserHandler(h, MwNdrawHandler, NULL);
|
||||
|
||||
MwLLEndDraw(handle);
|
||||
}
|
||||
|
||||
static void lluphandler(MwLL handle, void* data) {
|
||||
@@ -303,7 +307,10 @@ int MwStep(MwWidget handle) {
|
||||
arrfree(widgets);
|
||||
|
||||
handle->prop_event = 0;
|
||||
if(handle->lowlevel != NULL && MwLLPending(handle->lowlevel)) MwLLNextEvent(handle->lowlevel);
|
||||
|
||||
if(handle->lowlevel != NULL && MwLLPending(handle->lowlevel))
|
||||
MwLLNextEvent(handle->lowlevel);
|
||||
|
||||
handle->prop_event = 1;
|
||||
|
||||
clean_destroy_queue(handle);
|
||||
@@ -694,6 +701,9 @@ MwWidget MwGetParent(MwWidget handle) {
|
||||
typedef int (*call_t)(void);
|
||||
int MwLibraryInit(void) {
|
||||
call_t calls[] = {
|
||||
#ifdef USE_WAYLAND
|
||||
MwLLWaylandCallInit,
|
||||
#endif
|
||||
#ifdef USE_X11
|
||||
MwLLX11CallInit,
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user