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
commit 9a4c74ad93
18 changed files with 1424 additions and 12 deletions

1
src/backend/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
wayland*protocol.c

View file

@ -8,8 +8,10 @@
MwLLCreate = MwLLCreateImpl; \
MwLLDestroy = MwLLDestroyImpl; \
\
MwLLPolygon = MwLLPolygonImpl; \
MwLLLine = MwLLLineImpl; \
MwLLPolygon = MwLLPolygonImpl; \
MwLLLine = MwLLLineImpl; \
MwLLBeginDraw = MwLLBeginDrawImpl; \
MwLLEndDraw = MwLLEndDrawImpl; \
\
MwLLAllocColor = MwLLAllocColorImpl; \
MwLLColorUpdate = MwLLColorUpdateImpl; \

View file

@ -280,6 +280,14 @@ static void MwLLDestroyImpl(MwLL handle) {
free(handle);
}
static void MwLLBeginDrawImpl(MwLL handle) {
(void)handle;
}
static void MwLLEndDrawImpl(MwLL handle) {
(void)handle;
}
static void MwLLPolygonImpl(MwLL handle, MwPoint* points, int points_count, MwLLColor color) {
POINT* p = malloc(sizeof(*p) * points_count);
HPEN pen = CreatePen(PS_NULL, 0, RGB(0, 0, 0));

1150
src/backend/wayland.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -259,6 +259,14 @@ static void MwLLDestroyImpl(MwLL handle) {
free(handle);
}
static void MwLLBeginDrawImpl(MwLL handle) {
(void)handle;
}
static void MwLLEndDrawImpl(MwLL handle) {
(void)handle;
}
static void MwLLPolygonImpl(MwLL handle, MwPoint* points, int points_count, MwLLColor color) {
int i;
XPoint* p = malloc(sizeof(*p) * points_count);
@ -1028,7 +1036,6 @@ static void MwLLEndStateChangeImpl(MwLL handle) {
}
static int MwLLX11CallInitImpl(void) {
/* TODO: check properly */
return 0;
}