summaryrefslogtreecommitdiff
path: root/demos/gtk-demo
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-04-03 19:26:12 -0400
committerMatthias Clasen <mclasen@redhat.com>2023-04-03 23:05:38 -0400
commitb1f0ca7dc4c74fb34c5c9455cae197ef1464ac82 (patch)
tree71944c8a4240e17d1b51d2c10afe5f1c0c7c8b92 /demos/gtk-demo
parent9c26262e3e08300631c77727cdec318bd049a344 (diff)
downloadgtk+-b1f0ca7dc4c74fb34c5c9455cae197ef1464ac82.tar.gz
gtk-demo: Update the GLArea examples
Diffstat (limited to 'demos/gtk-demo')
-rw-r--r--demos/gtk-demo/glarea.c5
-rw-r--r--demos/gtk-demo/gtkgears.c7
2 files changed, 3 insertions, 9 deletions
diff --git a/demos/gtk-demo/glarea.c b/demos/gtk-demo/glarea.c
index 430f44cde0..43942f5f7e 100644
--- a/demos/gtk-demo/glarea.c
+++ b/demos/gtk-demo/glarea.c
@@ -221,16 +221,13 @@ static void
realize (GtkWidget *widget)
{
const char *vertex_path, *fragment_path;
- GdkGLContext *context;
gtk_gl_area_make_current (GTK_GL_AREA (widget));
if (gtk_gl_area_get_error (GTK_GL_AREA (widget)) != NULL)
return;
- context = gtk_gl_area_get_context (GTK_GL_AREA (widget));
-
- if (gdk_gl_context_get_use_es (context))
+ if (gtk_gl_area_get_api (GTK_GL_AREA (widget)) == GDK_GL_API_GLES)
{
vertex_path = "/glarea/glarea-gles.vs.glsl";
fragment_path = "/glarea/glarea-gles.fs.glsl";
diff --git a/demos/gtk-demo/gtkgears.c b/demos/gtk-demo/gtkgears.c
index 10a80b18e8..0c0ea3398a 100644
--- a/demos/gtk-demo/gtkgears.c
+++ b/demos/gtk-demo/gtkgears.c
@@ -737,7 +737,6 @@ gtk_gears_realize (GtkWidget *widget)
GtkGLArea *glarea = GTK_GL_AREA (widget);
GtkGears *gears = GTK_GEARS (widget);
GtkGearsPrivate *priv = gtk_gears_get_instance_private (gears);
- GdkGLContext *context;
GLuint vao, v, f, program;
const char *p;
char msg[512];
@@ -748,8 +747,6 @@ gtk_gears_realize (GtkWidget *widget)
if (gtk_gl_area_get_error (glarea) != NULL)
return;
- context = gtk_gl_area_get_context (glarea);
-
glEnable (GL_CULL_FACE);
glEnable (GL_DEPTH_TEST);
@@ -759,7 +756,7 @@ gtk_gears_realize (GtkWidget *widget)
priv->vao = vao;
/* Compile the vertex shader */
- if (gdk_gl_context_get_use_es (context))
+ if (gtk_gl_area_get_api (glarea) == GDK_GL_API_GLES)
p = vertex_shader_gles;
else
p = vertex_shader_gl;
@@ -770,7 +767,7 @@ gtk_gears_realize (GtkWidget *widget)
g_debug ("vertex shader info: %s\n", msg);
/* Compile the fragment shader */
- if (gdk_gl_context_get_use_es (context))
+ if (gtk_gl_area_get_api (glarea) == GDK_GL_API_GLES)
p = fragment_shader_gles;
else
p = fragment_shader_gl;