milsko/src/lowlevel.c
IoIxD 9a4c74ad93 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>
2025-12-09 20:11:01 -06:00

61 lines
2.1 KiB
C

#include <Mw/Milsko.h>
MwLL (*MwLLCreate)(MwLL parent, int x, int y, int width, int height);
void (*MwLLDestroy)(MwLL handle);
void (*MwLLPolygon)(MwLL handle, MwPoint* points, int points_count, MwLLColor color);
void (*MwLLLine)(MwLL handle, MwPoint* points, MwLLColor color);
void (*MwLLBeginDraw)(MwLL handle);
void (*MwLLEndDraw)(MwLL handle);
MwLLColor (*MwLLAllocColor)(MwLL handle, int r, int g, int b);
void (*MwLLColorUpdate)(MwLL handle, MwLLColor c, int r, int g, int b);
void (*MwLLFreeColor)(MwLLColor color);
void (*MwLLGetXYWH)(MwLL handle, int* x, int* y, unsigned int* w, unsigned int* h);
void (*MwLLSetXY)(MwLL handle, int x, int y);
void (*MwLLSetWH)(MwLL handle, int w, int h);
void (*MwLLSetTitle)(MwLL handle, const char* title);
int (*MwLLPending)(MwLL handle);
void (*MwLLNextEvent)(MwLL handle);
MwLLPixmap (*MwLLCreatePixmap)(MwLL handle, unsigned char* data, int width, int height);
void (*MwLLPixmapUpdate)(MwLLPixmap pixmap);
void (*MwLLDestroyPixmap)(MwLLPixmap pixmap);
void (*MwLLDrawPixmap)(MwLL handle, MwRect* rect, MwLLPixmap pixmap);
void (*MwLLSetIcon)(MwLL handle, MwLLPixmap pixmap);
void (*MwLLForceRender)(MwLL handle);
void (*MwLLSetCursor)(MwLL handle, MwCursor* image, MwCursor* mask);
void (*MwLLDetach)(MwLL handle, MwPoint* point);
void (*MwLLShow)(MwLL handle, int show);
void (*MwLLSetSizeHints)(MwLL handle, int minx, int miny, int maxx, int maxy);
void (*MwLLMakeBorderless)(MwLL handle, int toggle);
void (*MwLLMakeToolWindow)(MwLL handle);
void (*MwLLMakePopup)(MwLL handle, MwLL parent);
void (*MwLLBeginStateChange)(MwLL handle);
void (*MwLLEndStateChange)(MwLL handle);
void (*MwLLFocus)(MwLL handle);
void (*MwLLGrabPointer)(MwLL handle, int toggle);
void (*MwLLSetClipboard)(MwLL handle, const char* text);
char* (*MwLLGetClipboard)(MwLL handle);
void (*MwLLGetCursorCoord)(MwLL handle, MwPoint* point);
void (*MwLLGetScreenSize)(MwLL handle, MwRect* rect);
void MwLLCreateCommon(MwLL handle) {
handle->common.handler = malloc(sizeof(*handle->common.handler));
memset(handle->common.handler, 0, sizeof(*handle->common.handler));
}
void MwLLDestroyCommon(MwLL handle) {
free(handle->common.handler);
}