Skip to contentSkip to conversation

ui: use libexpoxy

PATCH In review Gerd Hoffmann 3 participants 4 messages May 12, 2015 – May 18, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ui: use libexpoxy

libepoxy does the opengl extension handling for us.

It also is helpful for trouble-shooting as it prints nice error messages instead of silently failing or segfaulting in case we do something wrong, like using gl commands not supported by the current context.

---
 configure            | 2 +-
 include/ui/console.h | 3 +--
 include/ui/shader.h  | 5 +----
 3 files changed, 3 insertions(+), 7 deletions(-)
configure +1 -1
index 1f0f485..df1048a 100755
@@ -3153,7 +3153,7 @@ else
 fi
 
 if test "$opengl" != "no" ; then
-  opengl_pkgs="gl glesv2"
+  opengl_pkgs="gl glesv2 epoxy"
   if $pkg_config $opengl_pkgs x11 && test "$have_glx" = "yes"; then
     opengl_cflags="$($pkg_config --cflags $opengl_pkgs) $x11_cflags"
     opengl_libs="$($pkg_config --libs $opengl_pkgs) $x11_libs"
include/ui/console.h +1 -2
index e8b3a9e..383dec2 100644
@@ -10,8 +10,7 @@
 #include "qapi/error.h"
 
 #ifdef CONFIG_OPENGL
-# include <GLES2/gl2.h>
-# include <GLES2/gl2ext.h>
+# include <epoxy/gl.h>
 #endif
 
 /* keyboard/mouse support */
include/ui/shader.h +1 -4
index 1ff926c..992cde6 100644
@@ -1,7 +1,4 @@
-#ifdef CONFIG_OPENGL
-# include <GLES2/gl2.h>
-# include <GLES2/gl2ext.h>
-#endif
+#include <epoxy/gl.h>
 
 void qemu_gl_run_texture_blit(GLint texture_blit_prog);
 
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 5 lines · Gerd Hoffmann

libepoxy does the opengl extension handling for us.

It also is helpful for trouble-shooting as it prints nice error messages instead of silently failing or segfaulting in case we do something wrong, like using gl commands not supported by the current context.

How widely supported is this library? How long has it been around, is it carried by all the distros, does it work ok on OSX and Windows?

I'm a bit uncertain about adding dependencies that would limit the scope where we can provide important functionality like 3D acceleration.

thanks
-- PMM

#2 lore raw
Quoted 7 lines · Peter Maydell
Quoted 5 lines · Gerd Hoffmann

libepoxy does the opengl extension handling for us.

It also is helpful for trouble-shooting as it prints nice error messages instead of silently failing or segfaulting in case we do something wrong, like using gl commands not supported by the current context.

Quoted 6 lines

How widely supported is this library? How long has it been around, is it carried by all the distros, does it work ok on OSX and Windows?

I'm a bit uncertain about adding dependencies that would limit the scope where we can provide important functionality like 3D acceleration.

https://github.com/anholt/libepoxy

It is relatively new (a bit more than a year old), supposed to work on both osx and windows (didn't test myself though), and it seems to be commonly included in distros (although newer versions only).

cheers,
Gerd

#3 lore raw
Quoted 10 lines · Gerd Hoffmann
Quoted 9 lines · Peter Maydell
Quoted 5 lines · Gerd Hoffmann

libepoxy does the opengl extension handling for us.

It also is helpful for trouble-shooting as it prints nice error messages instead of silently failing or segfaulting in case we do something wrong, like using gl commands not supported by the current context.

How widely supported is this library? How long has it been around, is it carried by all the distros, does it work ok on OSX and Windows?

Quoted 8 lines
Quoted 3 lines

I'm a bit uncertain about adding dependencies that would limit the scope where we can provide important functionality like 3D acceleration.

https://github.com/anholt/libepoxy

It is relatively new (a bit more than a year old), supposed to work on both osx and windows (didn't test myself though), and it seems to be commonly included in distros (although newer versions only).

It successfully disables OpenGL support on my 12.3 installation and thus fixes compilation there. Hooray ;).

Alex