[retro-gtk] gl-display: Call glBindTexture() on every frame
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk] gl-display: Call glBindTexture() on every frame
- Date: Thu, 26 Jul 2018 21:28:19 +0000 (UTC)
commit 64ad03ab6616b488c957d2d1732e51cb89065515
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Thu Jul 26 13:46:22 2018 +0500
gl-display: Call glBindTexture() on every frame
glBindTexture() changes global state, so if anything else uses OpenGL
textures, it also corrupts RetroGLDisplay state. Calling it every time
in retro_gl_display_load_texture() ensures that we're always working with
the right texture.
retro-gtk/retro-gl-display.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/retro-gtk/retro-gl-display.c b/retro-gtk/retro-gl-display.c
index 93a8ea8..68c40ac 100644
--- a/retro-gtk/retro-gl-display.c
+++ b/retro-gtk/retro-gl-display.c
@@ -125,6 +125,8 @@ retro_gl_display_load_texture (RetroGLDisplay *self,
gint *texture_width,
gint *texture_height)
{
+ glBindTexture (GL_TEXTURE_2D, self->texture);
+
if (self->pixdata != NULL) {
*texture_width = retro_pixdata_get_width (self->pixdata);
*texture_height = retro_pixdata_get_height (self->pixdata);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]