From 37683dff4a5215ba524bc7eccc22206388051374 Mon Sep 17 00:00:00 2001 From: mittorn Date: Thu, 11 Jun 2015 14:22:27 +0700 Subject: [PATCH] Add some functions to nanogl.h interface --- GL/nanogl.h | 4 +++- nanoWrap.cpp | 12 ++++++++++-- nanogl.cpp | 6 +++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/GL/nanogl.h b/GL/nanogl.h index ff7ca61..99102fa 100644 --- a/GL/nanogl.h +++ b/GL/nanogl.h @@ -27,7 +27,9 @@ extern "C" { int nanoGL_Init(void); void nanoGL_Destroy(void); - +void nanoGL_Flush(); +void *nanoGL_GetProcAddress(const char *); +void nanoGL_Reset(); #ifdef __cplusplus } #endif diff --git a/nanoWrap.cpp b/nanoWrap.cpp index 27daf14..a30a009 100644 --- a/nanoWrap.cpp +++ b/nanoWrap.cpp @@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "gl.h" #include "glesinterface.h" +#include "nanogl.h" #define GL_TEXTURE0_ARB 0x84C0 #define GL_TEXTURE1_ARB 0x84C1 @@ -360,7 +361,14 @@ void FlushOnStateChange() ptrIndexArray = indexArray; useTexCoordArray = GL_FALSE; } - +void nanoGL_Flush() + { + FlushOnStateChange(); + } +void nanoGL_Reset() +{ + ResetNanoState(); +} void glBegin(GLenum mode) { wrapperPrimitiveMode = mode; @@ -1412,7 +1420,7 @@ void glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) GLenum glGetError (void) { - FlushOnStateChange(); + //FlushOnStateChange(); return GL_NO_ERROR;//glEsImpl->glGetError(); } diff --git a/nanogl.cpp b/nanogl.cpp index c16a7a0..5add36a 100644 --- a/nanogl.cpp +++ b/nanogl.cpp @@ -70,6 +70,10 @@ static void gl_unimplemented() { LOGE ("Called unimplemented OpenGL ES API\n"); } +void *nanoGL_GetProcAddress(const char *name) +{ + return dlsym(glesLib, name); +} static int CreateGlEsInterface( const char * name, void * lib, void * lib1, void * default_func ) { @@ -92,7 +96,7 @@ static int CreateGlEsInterface( const char * name, void * lib, void * lib1, void { void * f; - f = dlsym(lib, *api); // ltry ibGLESxx_CM.so + f = dlsym(lib, *api); // try libGLESxx_CM.so if (f == NULL) { LOGW( "<%s> not found in %s. Trying libEGL.so.", *api, name); //driver); -- 2.29.2