2018-10-28 17:29:51 +01:00
|
|
|
#ifndef __GTK_WAYLAND_EGL_CONTEXT_H
|
|
|
|
#define __GTK_WAYLAND_EGL_CONTEXT_H
|
|
|
|
|
2018-11-07 01:46:44 +01:00
|
|
|
|
2018-10-22 01:03:35 +02:00
|
|
|
#include <wayland-egl.h>
|
|
|
|
#include <epoxy/egl.h>
|
|
|
|
|
2018-10-27 01:22:51 +02:00
|
|
|
#include "gtk_opengl_context.h"
|
|
|
|
|
2018-10-28 17:29:51 +01:00
|
|
|
class WaylandEGLContext : public OpenGLContext
|
2018-10-22 01:03:35 +02:00
|
|
|
{
|
2018-10-28 17:29:51 +01:00
|
|
|
public:
|
2018-10-26 22:49:56 +02:00
|
|
|
WaylandEGLContext ();
|
|
|
|
~WaylandEGLContext ();
|
2018-10-27 01:22:51 +02:00
|
|
|
bool attach (GtkWidget *widget);
|
|
|
|
bool create_context ();
|
|
|
|
void resize ();
|
2018-10-22 01:03:35 +02:00
|
|
|
void swap_buffers ();
|
|
|
|
void swap_interval (int frames);
|
|
|
|
void make_current ();
|
|
|
|
|
|
|
|
GdkWindow *gdk_window;
|
|
|
|
|
|
|
|
struct wl_display *display;
|
|
|
|
struct wl_registry *registry;
|
|
|
|
struct wl_compositor *compositor;
|
|
|
|
struct wl_subcompositor *subcompositor;
|
|
|
|
|
|
|
|
struct wl_surface *parent;
|
|
|
|
struct wl_surface *child;
|
|
|
|
struct wl_subsurface *subsurface;
|
|
|
|
struct wl_region *region;
|
|
|
|
|
|
|
|
EGLDisplay egl_display;
|
|
|
|
EGLSurface egl_surface;
|
|
|
|
EGLContext egl_context;
|
|
|
|
EGLConfig egl_config;
|
|
|
|
|
|
|
|
wl_egl_window *egl_window;
|
|
|
|
};
|
2018-10-28 17:29:51 +01:00
|
|
|
|
|
|
|
#endif
|