From 4ec4346f072b457cfe0cd54d824c9c6b63dc3efd Mon Sep 17 00:00:00 2001 From: Guy Zadikario Date: Sat, 4 Jun 2011 18:48:19 +0300 Subject: [PATCH] emulator egl translator: Fix eglGetProcAddress. Fixed eglGetProcAddress when called for egl extension functions. Also fixed a typo in the EGL extension string. Change-Id: Ia081257fa641182246eec723d08ae2e9148ca0cc --- tools/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp b/tools/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp index c17d2746f..999d13a78 100644 --- a/tools/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp +++ b/tools/emulator/opengl/host/libs/Translator/EGL/EglImp.cpp @@ -69,6 +69,8 @@ static ExtentionDescriptor s_eglExtentions[] = { {"eglCreateImageKHR" ,(__eglMustCastToProperFunctionPointerType)eglCreateImageKHR}, {"eglDestroyImageKHR",(__eglMustCastToProperFunctionPointerType)eglDestroyImageKHR} }; +static int s_eglExtentionsSize = sizeof(s_eglExtentions) / + sizeof(ExtentionDescriptor); /****************************************************************************************************************************************/ //macros for accessing global egl info & tls objects @@ -213,7 +215,7 @@ EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay display, EGLint name) VALIDATE_DISPLAY(display); static const char* vendor = "Google"; static const char* version = "1.4"; - static const char* extensions = "EGL_KHR_image_base EGL_KHR_gl_texture_2d_image"; + static const char* extensions = "EGL_KHR_image_base EGL_KHR_gl_texture_2D_image"; if(!EglValidate::stringName(name)) { RETURN_ERROR(NULL,EGL_BAD_PARAMETER); } @@ -958,7 +960,7 @@ EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const char *procname){ __eglMustCastToProperFunctionPointerType retVal = NULL; if(!strncmp(procname,"egl",3)) { //EGL proc - for(int i=0;i < EGL_EXTENSIONS;i++){ + for(int i=0;i < s_eglExtentionsSize;i++){ if(strcmp(procname,s_eglExtentions[i].name) == 0){ retVal = s_eglExtentions[i].address; break;