summaryrefslogtreecommitdiff
path: root/gtk/gtkglarea.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2016-04-25 12:28:41 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2016-04-25 14:35:02 +0100
commitb45c7b508bd7be1ec6c0d589a14a783133adb0a2 (patch)
tree6e329396074de34bdb1aa9b87c9e77d8c9fd7950 /gtk/gtkglarea.c
parent971998de34b570fcf3eb2149198e5679b747901d (diff)
downloadgtk+-b45c7b508bd7be1ec6c0d589a14a783133adb0a2.tar.gz
glarea: Use the appropriate texture format for GLES
The core OpenGL ES spec does not have GL_BGRA, so we need to make do with GL_RGBA and live with the format conversion.
Diffstat (limited to 'gtk/gtkglarea.c')
-rw-r--r--gtk/gtkglarea.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c
index 480388636b..094378e65f 100644
--- a/gtk/gtkglarea.c
+++ b/gtk/gtkglarea.c
@@ -458,7 +458,11 @@ gtk_gl_area_allocate_buffers (GtkGLArea *area)
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL);
+
+ if (gdk_gl_context_get_use_es (priv->context))
+ glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ else
+ glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL);
}
if (priv->render_buffer)