Permalink
Browse files

proper linking support for GLES2 and GLES3 families

  • Loading branch information...
1 parent 9b24392 commit a6776caedff69415ff8929b3bc72171ff98d9d6b @krogue2 krogue2 committed May 14, 2014
Showing with 24 additions and 3 deletions.
  1. +2 −1 Makefile.settings
  2. +17 −1 ngl_generator/filter.cpp
  3. +5 −1 src/WRATH/gl/WRATHGPUConfig.cpp
View
@@ -26,7 +26,7 @@ GLES_LIB_PATH_FLAGS= -L/opt/mesa/lib
# 2 = GLES2 or OpenGL 2.x
# 3 = GLES3 or OpenGL 3.x Core
# 4 = GLES4(when it appears) or OpenGL 4.x Core
-GL_VERSION=2
+GL_VERSION=3
# GL type
# 0 = GLES
@@ -45,6 +45,7 @@ GL_VERSION=2
# OVERRIDE_GL_TYPE=1 # for desktop GL
GL_TYPE=1
+
ifeq ($(findstring arm,$(shell uname -m)),arm)
GL_TYPE=0
endif
View
@@ -26,12 +26,28 @@
bool
use_function_pointer(const std::string &filename)
{
+ return true;
+
+ /*
+ Bah humbug: just require that ngl_backend implementation
+ can handle functions that are core in GLES2.so The issue
+ is that GLES3 is the same .so as GLES2, so to get its
+ function pointers means one needs to use eglGetProcAddress,
+ so telling by the filename will not work. The correct thing
+ is that we have a list of all the GLES2 core functions
+ and if it is not one of those, then do the eglGetProcAdress.
+ However, dlopen and dlsym can be used instead to get the
+ function pointers even if the function is core GLES2,
+ so we just always fetch the fnction pointer.
+
return filename.find("gl2.h")==std::string::npos;
+ */
}
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
/*read each file passed and output them to stdout after filtering */
@@ -76,9 +76,13 @@ WRATHGPUConfig::
default_shader_version(void)
{
#if defined(WRATH_GLES_VERSION) && WRATH_GLES_VERSION>=3
+ {
return "300 es";
+ }
#elif defined(WRATH_GL_VERSION) && WRATH_GL_VERSION>=3
- return "330 core";
+ {
+ return "130";
+ }
#endif
return "";

0 comments on commit a6776ca

Please sign in to comment.