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() {
|
int main() {
|
||||||
MwSizeHints hints;
|
MwSizeHints hints;
|
||||||
MwWidget window;
|
MwWidget window, viewport;
|
||||||
|
|
||||||
MwLibraryInit();
|
MwLibraryInit();
|
||||||
|
|
||||||
window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 480,
|
window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 480,
|
||||||
MwNtitle, "tripaint",
|
MwNtitle, "tripaint",
|
||||||
NULL);
|
NULL);
|
||||||
|
viewport = MwCreateWidget(MwViewportClass, "viewport", window, 5, 5, 630, 470 - 16 - 5);
|
||||||
|
|
||||||
hints.min_width = hints.max_width = 640;
|
hints.min_width = hints.max_width = 640;
|
||||||
hints.min_height = hints.max_height = 480;
|
hints.min_height = hints.max_height = 480;
|
||||||
|
|
@ -126,7 +127,7 @@ int main() {
|
||||||
|
|
||||||
t = malloc(sizeof(*t));
|
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(window, MwNtickHandler, tick, NULL);
|
||||||
MwAddUserHandler(opengl, MwNtickHandler, tick, NULL);
|
MwAddUserHandler(opengl, MwNtickHandler, tick, NULL);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
#include <sys/mman.h>
|
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
|
|
||||||
#include <Mw/Milsko.h>
|
#include <Mw/Milsko.h>
|
||||||
|
|
@ -56,6 +55,7 @@ typedef struct x11opengl {
|
||||||
#ifdef USE_WAYLAND
|
#ifdef USE_WAYLAND
|
||||||
#include <EGL/egl.h>
|
#include <EGL/egl.h>
|
||||||
#include <wayland-egl-core.h>
|
#include <wayland-egl-core.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
#include <gbm.h>
|
#include <gbm.h>
|
||||||
typedef void* EGLLabelKHR;
|
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
|
#ifdef USE_WAYLAND
|
||||||
|
static void frontbuffer_draw(MwWidget handle) {
|
||||||
if(handle->lowlevel->common.type == MwLLBackendWayland) {
|
if(handle->lowlevel->common.type == MwLLBackendWayland) {
|
||||||
waylandopengl_t* o = handle->internal;
|
waylandopengl_t* o = handle->internal;
|
||||||
MwRect r;
|
MwRect r;
|
||||||
|
|
@ -606,9 +606,8 @@ static void frontbuffer_draw(MwWidget handle) {
|
||||||
r.height = handle->lowlevel->wayland.wh;
|
r.height = handle->lowlevel->wayland.wh;
|
||||||
MwLLDrawPixmap(handle->lowlevel, &r, o->frontbuffer);
|
MwLLDrawPixmap(handle->lowlevel, &r, o->frontbuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
MwClassRec MwOpenGLClassRec = {wcreate, /* create */
|
MwClassRec MwOpenGLClassRec = {wcreate, /* create */
|
||||||
destroy, /* destroy */
|
destroy, /* destroy */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue