wayland: guard sys/mman.h
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
97778752ec
commit
38d1cb7289
2 changed files with 9 additions and 9 deletions
|
|
@ -108,13 +108,14 @@ static void MWAPI mouse_move(MwWidget handle, void* user, void* call) {
|
|||
|
||||
int main() {
|
||||
MwSizeHints hints;
|
||||
MwWidget window;
|
||||
MwWidget window, viewport;
|
||||
|
||||
MwLibraryInit();
|
||||
|
||||
window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 480,
|
||||
MwNtitle, "tripaint",
|
||||
NULL);
|
||||
window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 480,
|
||||
MwNtitle, "tripaint",
|
||||
NULL);
|
||||
viewport = MwCreateWidget(MwViewportClass, "viewport", window, 5, 5, 630, 470 - 16 - 5);
|
||||
|
||||
hints.min_width = hints.max_width = 640;
|
||||
hints.min_height = hints.max_height = 480;
|
||||
|
|
@ -126,7 +127,7 @@ int main() {
|
|||
|
||||
t = malloc(sizeof(*t));
|
||||
|
||||
opengl = MwCreateWidget(MwOpenGLClass, "opengl", window, 0, 0, 640, 460);
|
||||
opengl = MwCreateWidget(MwOpenGLClass, "opengl", viewport, 0, 0, 1024, 768);
|
||||
|
||||
MwAddUserHandler(window, MwNtickHandler, tick, NULL);
|
||||
MwAddUserHandler(opengl, MwNtickHandler, tick, NULL);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
#include <sys/mman.h>
|
||||
#ifndef __APPLE__
|
||||
|
||||
#include <Mw/Milsko.h>
|
||||
|
|
@ -56,6 +55,7 @@ typedef struct x11opengl {
|
|||
#ifdef USE_WAYLAND
|
||||
#include <EGL/egl.h>
|
||||
#include <wayland-egl-core.h>
|
||||
#include <sys/mman.h>
|
||||
#include <gbm.h>
|
||||
typedef void* EGLLabelKHR;
|
||||
|
||||
|
|
@ -595,8 +595,8 @@ static void func_handler(MwWidget handle, const char* name, void* out,
|
|||
}
|
||||
}
|
||||
|
||||
static void frontbuffer_draw(MwWidget handle) {
|
||||
#ifdef USE_WAYLAND
|
||||
static void frontbuffer_draw(MwWidget handle) {
|
||||
if(handle->lowlevel->common.type == MwLLBackendWayland) {
|
||||
waylandopengl_t* o = handle->internal;
|
||||
MwRect r;
|
||||
|
|
@ -606,9 +606,8 @@ static void frontbuffer_draw(MwWidget handle) {
|
|||
r.height = handle->lowlevel->wayland.wh;
|
||||
MwLLDrawPixmap(handle->lowlevel, &r, o->frontbuffer);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
MwClassRec MwOpenGLClassRec = {wcreate, /* create */
|
||||
destroy, /* destroy */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue