GTK+: Turn context structs into classes.

Remove placeholder "#pragma once" uses.
This commit is contained in:
Brandon Wright 2018-10-28 11:29:51 -05:00
parent c4412fa77b
commit 7dcf6a0ce4
3 changed files with 21 additions and 6 deletions

View File

@ -1,12 +1,15 @@
#pragma once
#ifndef __GTK_GLX_CONTEXT_H
#define __GTK_GLX_CONTEXT_H
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <epoxy/glx.h>
#include "gtk_opengl_context.h"
struct GTKGLXContext : OpenGLContext
class GTKGLXContext : public OpenGLContext
{
public:
GTKGLXContext ();
~GTKGLXContext ();
bool attach (GtkWidget *widget);
@ -33,3 +36,5 @@ struct GTKGLXContext : OpenGLContext
int version_major;
int version_minor;
};
#endif

View File

@ -1,8 +1,11 @@
#pragma once
#ifndef __GTK_OPENGL_CONTEXT_H
#define __GTK_OPENGL_CONTEXT_H
#include <gtk/gtk.h>
struct OpenGLContext
class OpenGLContext
{
public:
virtual bool attach (GtkWidget *widget) = 0;
virtual bool create_context () = 0;
virtual void resize () = 0;
@ -15,3 +18,5 @@ struct OpenGLContext
int width;
int height;
};
#endif

View File

@ -1,12 +1,15 @@
#pragma once
#ifndef __GTK_WAYLAND_EGL_CONTEXT_H
#define __GTK_WAYLAND_EGL_CONTEXT_H
#include <gdk/gdkwayland.h>
#include <wayland-egl.h>
#include <epoxy/egl.h>
#include "gtk_opengl_context.h"
struct WaylandEGLContext : OpenGLContext
class WaylandEGLContext : public OpenGLContext
{
public:
WaylandEGLContext ();
~WaylandEGLContext ();
bool attach (GtkWidget *widget);
@ -35,3 +38,5 @@ struct WaylandEGLContext : OpenGLContext
wl_egl_window *egl_window;
};
#endif