Commits

Murat Sari committed e201d85

GLES2: Add support for the latest PowerVR emu

  • Participants
  • Parent commits c8e93e6
  • Branches v1-9

Comments (0)

Files changed (5)

RenderSystems/GLES2/include/OgreGLES2Prerequisites.h

 #       undef GL_OES_mapbuffer
 #	endif
 #else
+#	undef  GL_GLEXT_PROTOTYPES
 #   include <GLES2/gl2.h>
 #   include <GLES2/gl2ext.h>
 #   include <EGL/egl.h>
 
-// Function pointers for FBO extension methods
-// Declare them here since we don't have GLEW to do it for us
-
 #	ifndef GL_GLEXT_PROTOTYPES
 extern PFNGLMAPBUFFEROESPROC glMapBufferOES;
 extern PFNGLUNMAPBUFFEROESPROC glUnmapBufferOES;
+#		if OGRE_PLATFORM != OGRE_PLATFORM_WIN32
 extern PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB;
 extern PFNGLREADBUFFERNVPROC glReadBufferNV;
 extern PFNGLGETCOMPRESSEDTEXIMAGENVPROC glGetCompressedTexImageNV;
 extern PFNGLGETTEXIMAGENVPROC glGetTexImageNV;
 extern PFNGLGETTEXLEVELPARAMETERFVNVPROC glGetTexLevelParameterfvNV;
 extern PFNGLGETTEXLEVELPARAMETERiVNVPROC glGetTexLevelParameterivNV;
+#		else
+typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOES) (GLuint vertexarray);
+typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOES) (GLsizei n, const GLuint *vertexarrays);
+typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOES) (GLsizei n, GLuint *vertexarrays);
+typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOES) (GLuint vertexarray);
+
+extern PFNGLBINDVERTEXARRAYOES glBindVertexArrayOES;
+extern PFNGLDELETEVERTEXARRAYSOES glDeleteVertexArraysOES;
+extern PFNGLGENVERTEXARRAYSOES glGenVertexArraysOES;
+extern PFNGLISVERTEXARRAYOES glIsVertexArrayOES;
+#		endif
 #	endif
 
 // If we are going to use the PVRTC_CODEC make sure we

RenderSystems/GLES2/src/EGL/WIN32/OgreWin32EGLSupport.cpp

 		EGLConfig *glConfigs;
 		int config, nConfigs = 0;
 
-		glConfigs = chooseGLConfig(NULL, &nConfigs);
+		EGLint const attrib_list[] =  {
+			EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
+			EGL_BUFFER_SIZE, 32,
+			EGL_DEPTH_SIZE, 24,
+			EGL_STENCIL_SIZE, 8,
+			EGL_NONE
+		};
+
+		glConfigs = chooseGLConfig(attrib_list, &nConfigs);
 
 		for (config = 0; config < nConfigs; config++)
 		{

RenderSystems/GLES2/src/EGL/WIN32/OgreWin32EGLWindow.cpp

 		}
 
 		mContext = createEGLContext();
-
+		mContext->setCurrent();
         ::EGLSurface oldDrawableDraw = eglGetCurrentSurface(EGL_DRAW);
         ::EGLSurface oldDrawableRead = eglGetCurrentSurface(EGL_READ);
         ::EGLContext oldContext  = eglGetCurrentContext();

RenderSystems/GLES2/src/OgreGLES2RenderSystem.cpp

 #	ifndef GL_GLEXT_PROTOTYPES
     PFNGLMAPBUFFEROESPROC glMapBufferOES = NULL;
     PFNGLUNMAPBUFFEROESPROC glUnmapBufferOES = NULL;
+#		if OGRE_PLATFORM != OGRE_PLATFORM_WIN32
     PFNGLDRAWBUFFERSARBPROC glDrawBuffersARB = NULL;
     PFNGLREADBUFFERNVPROC glReadBufferNV = NULL;
     PFNGLGETCOMPRESSEDTEXIMAGENVPROC glGetCompressedTexImageNV = NULL;
     PFNGLGETTEXIMAGENVPROC glGetTexImageNV = NULL;
     PFNGLGETTEXLEVELPARAMETERFVNVPROC glGetTexLevelParameterfvNV = NULL;
     PFNGLGETTEXLEVELPARAMETERiVNVPROC glGetTexLevelParameterivNV = NULL;
+#		else
+	PFNGLBINDVERTEXARRAYOES glBindVertexArrayOES = NULL;
+	PFNGLDELETEVERTEXARRAYSOES glDeleteVertexArraysOES = NULL;
+	PFNGLGENVERTEXARRAYSOES glGenVertexArraysOES = NULL;
+	PFNGLISVERTEXARRAYOES glIsVertexArrayOES = NULL;
+#		endif
 #	endif
 
 #endif

RenderSystems/GLES2/src/OgreGLES2Support.cpp

 #   endif
         glMapBufferOES = (PFNGLMAPBUFFEROES)getProcAddress("glMapBufferOES");
         glUnmapBufferOES = (PFNGLUNMAPBUFFEROES)getProcAddress("glUnmapBufferOES");
+#		if OGRE_PLATFORM != OGRE_PLATFORM_WIN32
         glDrawBuffersARB = (PFNGLDRAWBUFFERSARB)getProcAddress("glDrawBuffersARB");
         glReadBufferNV = (PFNGLREADBUFFERNV)getProcAddress("glReadBufferNV");
         glGetTexImageNV = (PFNGLGETTEXIMAGENV)getProcAddress("glGetTexImageNV");
         glGetCompressedTexImageNV = (PFNGLGETCOMPRESSEDTEXIMAGENV)getProcAddress("glGetCompressedTexImageNV");
         glGetTexLevelParameterfvNV = (PFNGLGETTEXLEVELPARAMETERFVNV)getProcAddress("glGetTexLevelParameterfvNV");
         glGetTexLevelParameterivNV = (PFNGLGETTEXLEVELPARAMETERiVNV)getProcAddress("glGetTexLevelParameterivNV");
+#		else
+		glBindVertexArrayOES = (PFNGLBINDVERTEXARRAYOES) getProcAddress("glBindVertexArrayOES");
+		glDeleteVertexArraysOES = (PFNGLDELETEVERTEXARRAYSOES) getProcAddress("glDeleteVertexArraysOES");
+		glGenVertexArraysOES = (PFNGLGENVERTEXARRAYSOES) getProcAddress("glGenVertexArraysOES");
+		glIsVertexArrayOES = (PFNGLISVERTEXARRAYOES) getProcAddress("glIsVertexArrayOES");
+#		endif
 #endif
 }