mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-09 02:43:30 +00:00
remove egl dependency
This commit is contained in:
@@ -12,10 +12,6 @@
|
|||||||
#include <Mw/LowLevel.h>
|
#include <Mw/LowLevel.h>
|
||||||
|
|
||||||
#include <wayland-client-protocol.h>
|
#include <wayland-client-protocol.h>
|
||||||
#include <wayland-egl.h>
|
|
||||||
#include <EGL/egl.h>
|
|
||||||
#include <GL/gl.h>
|
|
||||||
#include <GL/glext.h>
|
|
||||||
|
|
||||||
#include <wayland-client.h>
|
#include <wayland-client.h>
|
||||||
#include <xkbcommon/xkbcommon.h>
|
#include <xkbcommon/xkbcommon.h>
|
||||||
@@ -115,8 +111,6 @@ struct _MwLLWaylandColor {
|
|||||||
|
|
||||||
struct _MwLLWaylandPixmap {
|
struct _MwLLWaylandPixmap {
|
||||||
struct _MwLLCommonPixmap common;
|
struct _MwLLCommonPixmap common;
|
||||||
GLuint texture;
|
|
||||||
MwBool texture_deleted;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -827,17 +827,8 @@ static MwLLPixmap MwLLCreatePixmapImpl(MwLL handle, unsigned char* data, int wid
|
|||||||
|
|
||||||
r->common.width = width;
|
r->common.width = width;
|
||||||
r->common.height = height;
|
r->common.height = height;
|
||||||
r->common.raw = data;
|
r->common.raw = malloc(4 * width * height);
|
||||||
r->wayland.texture = 0;
|
memcpy(r->common.raw, data, 4 * width * height);
|
||||||
|
|
||||||
glGenTextures(1, &r->wayland.texture);
|
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, r->wayland.texture);
|
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
|
||||||
|
|
||||||
MwLLPixmapUpdate(r);
|
MwLLPixmapUpdate(r);
|
||||||
|
|
||||||
@@ -845,13 +836,10 @@ static MwLLPixmap MwLLCreatePixmapImpl(MwLL handle, unsigned char* data, int wid
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLPixmapUpdateImpl(MwLLPixmap r) {
|
static void MwLLPixmapUpdateImpl(MwLLPixmap r) {
|
||||||
glBindTexture(GL_TEXTURE_2D, r->wayland.texture);
|
/* TODO */
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, r->common.width, r->common.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, r->common.raw);
|
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLDestroyPixmapImpl(MwLLPixmap pixmap) {
|
static void MwLLDestroyPixmapImpl(MwLLPixmap pixmap) {
|
||||||
glDeleteTextures(1, &pixmap->wayland.texture);
|
|
||||||
free(pixmap);
|
free(pixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user