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:
IoIxD
2025-12-09 20:11:01 -06:00
committed by IoI_xD
parent 6f331d613d
commit 9a4c74ad93
18 changed files with 1424 additions and 12 deletions

View File

@@ -25,7 +25,8 @@ typedef void* MwLLPixmap;
enum MwLLBackends {
MwLLBackendX11 = 0,
MwLLBackendGDI
MwLLBackendGDI,
MwLLBackendWayland,
};
struct _MwLLCommon {
@@ -55,6 +56,9 @@ struct _MwLLCommonPixmap {
#ifdef USE_GDI
#include <Mw/LowLevel/GDI.h>
#endif
#ifdef USE_WAYLAND
#include <Mw/LowLevel/Wayland.h>
#endif
union _MwLL {
struct _MwLLCommon common;
@@ -64,6 +68,9 @@ union _MwLL {
#ifdef USE_GDI
struct _MwLLGDI gdi;
#endif
#ifdef USE_WAYLAND
struct _MwLLWayland wayland;
#endif
};
union _MwLLColor {
@@ -74,6 +81,9 @@ union _MwLLColor {
#ifdef USE_GDI
struct _MwLLGDIColor gdi;
#endif
#ifdef USE_WAYLAND
struct _MwLLWaylandColor wayland;
#endif
};
union _MwLLPixmap {
@@ -84,6 +94,9 @@ union _MwLLPixmap {
#ifdef USE_GDI
struct _MwLLGDIPixmap gdi;
#endif
#ifdef USE_WAYLAND
struct _MwLLWaylandPixmap wayland;
#endif
};
#endif
#include <Mw/TypeDefs.h>
@@ -149,6 +162,8 @@ MWDECL void (*MwLLDestroy)(MwLL handle);
MWDECL void (*MwLLPolygon)(MwLL handle, MwPoint* points, int points_count, MwLLColor color);
MWDECL void (*MwLLLine)(MwLL handle, MwPoint* points, MwLLColor color);
MWDECL void (*MwLLBeginDraw)(MwLL handle);
MWDECL void (*MwLLEndDraw)(MwLL handle);
MWDECL MwLLColor (*MwLLAllocColor)(MwLL handle, int r, int g, int b);
MWDECL void (*MwLLColorUpdate)(MwLL handle, MwLLColor c, int r, int g, int b);