summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5436425)
raw | patch | inline | side by side (parent: 5436425)
Fix typo in nanoGL_GetProcAddress, return 1 in nanoGL_Init() if wrapper already initi... shared_nanogl
author | a1batross <a1ba.omarov@gmail.com> | |
Sun, 23 Aug 2015 18:52:58 +0000 (00:52 +0600) | ||
committer | a1batross <a1ba.omarov@gmail.com> | |
Sun, 23 Aug 2015 18:52:58 +0000 (00:52 +0600) |
nanogl.cpp | patch | blob | history |
diff --git a/nanogl.cpp b/nanogl.cpp
index 9130cecc1edfdca1da94048b5c359efc85ab7f9f..64c5f4da9eb5f8b90faec6a93af1f35590197867 100644 (file)
--- a/nanogl.cpp
+++ b/nanogl.cpp
GlESInterface* glEsImpl = NULL;
+int initialized = 0;
+
extern void InitGLStructs();
static void gl_unimplemented() {
LOGE ("Called unimplemented OpenGL ES API\n");
}
-void *nanoGL_GetProcAddress(const char *name)
+void *nanoGL_GetProcAddress(const char *procname)
{
#if defined(__MULTITEXTURE_SUPPORT__)
if (!strcmp(procname, "glMultiTexCoord2fARB"))
return (void*)&glClientActiveTexture;
}
#endif
- return dlsym(glesLib, name);
+ return dlsym(glesLib, procname);
}
static int CreateGlEsInterface( const char * name, void * lib, void * lib1, void * default_func )
*/
int nanoGL_Init()
{
+ if( initialized ) return 1;
+
const char * lib1 = "libGLESv1_CM.so"; // Has both gl* & egl* funcs SDK < 1.5
const char * lib2 = "libGLESv2.so"; // Only gl* funcs SDK >= 1.5
const char * lib3 = "libEGL.so"; // Only egl* funcs SDK >= 1.5
// Init nanoGL
InitGLStructs();
+ initialized = 1;
return 1;
}