#include <wayland-egl.h>
-#define EGL_EGLEXT_PROTOTYPES 1
-#define GL_GLEXT_PROTOTYPES 1
#include <GL/gl.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
cairo_surface_t **pointer_surfaces;
display_global_handler_t global_handler;
+
+ PFNGLEGLIMAGETARGETTEXTURE2DOESPROC image_target_texture_2d;
+ PFNEGLCREATEIMAGEKHRPROC create_image;
+ PFNEGLDESTROYIMAGEKHRPROC destroy_image;
};
struct window {
glDeleteTextures(1, &data->texture);
cairo_device_release(d->device);
- eglDestroyImageKHR(d->dpy, data->image);
+ d->destroy_image(d->dpy, data->image);
wl_buffer_destroy(data->data.buffer);
wl_egl_pixmap_destroy(data->pixmap);
free(p);
return NULL;
}
- data->image = eglCreateImageKHR(dpy, NULL,
- EGL_NATIVE_PIXMAP_KHR,
- (EGLClientBuffer) data->pixmap, NULL);
+ data->image = display->create_image(dpy, NULL,
+ EGL_NATIVE_PIXMAP_KHR,
+ (EGLClientBuffer) data->pixmap,
+ NULL);
if (data->image == EGL_NO_IMAGE_KHR) {
wl_egl_pixmap_destroy(data->pixmap);
free(data);
cairo_device_acquire(display->device);
glGenTextures(1, &data->texture);
glBindTexture(GL_TEXTURE_2D, data->texture);
- glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, data->image);
+ display->image_target_texture_2d(GL_TEXTURE_2D, data->image);
cairo_device_release(display->device);
surface = cairo_gl_surface_create_for_texture(display->device,
if (init_egl(d) < 0)
return NULL;
+ d->image_target_texture_2d =
+ (void *) eglGetProcAddress("glEGLImageTargetTexture2DOES");
+ d->create_image = (void *) eglGetProcAddress("eglCreateImageKHR");
+ d->destroy_image = (void *) eglGetProcAddress("eglDestroyImageKHR");
+
create_pointer_surfaces(d);
display_render_frame(d);