From: mittorn Date: Mon, 19 Jun 2017 07:08:23 +0000 (+0000) Subject: Change getProcAddress search order X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=c9df6debac1019db0571b92df54a3ae8d5b3454f;p=nanogl.git Change getProcAddress search order --- diff --git a/nanogl.cpp b/nanogl.cpp index 25ab85d..90fa364 100644 --- a/nanogl.cpp +++ b/nanogl.cpp @@ -135,14 +135,13 @@ void *nanoGL_GetProcAddress( const char *name ) addr = SDL_GL_GetProcAddress( name ); if ( !addr ) #endif + addr = procAddress( glesLib, name ); #ifdef NANOGL_EGL - if( glEsImpl->eglGetProcAddress ) - addr = (void *)glEsImpl->eglGetProcAddress( name ); if( !addr ) addr = procAddress( eglLib, name ); - if( !addr ) + if( !addr && glEsImpl->eglGetProcAddress ) + addr = (void *)glEsImpl->eglGetProcAddress( name ); #endif - addr = procAddress( glesLib, name ); return addr; } @@ -157,6 +156,7 @@ int nanoGL_Init( void) // alloc space if ( !glEsImpl ) glEsImpl = (GlESInterface *)malloc( sizeof( GlESInterface ) ); + memset( glEsImpl, 0, sizeof( GlESInterface ) ); #ifdef NANOGL_EGL eglLib = loadDriver( EGL_LIB );