Minor problems/fixes in RenderSystem_GLES on Windows

Minor issues with the Ogre API that can be trivial to fix
WindUpCats
Gnoblar
Posts: 6
Joined: Sat Mar 12, 2011 7:02 pm

Minor problems/fixes in RenderSystem_GLES on Windows

Post by WindUpCats »

I'm trying to get Ogre (last checkout) running in the Windows emulator (OpenGL ES 1 (fixed shaders) + 2 (programmable shaders)) from Imagination Technologies, to evaluate cross-platform (mobile and PC) development and usage of Ogre. I'm getting the following papercuts in MSVC10.

CMake seems to be including the wrong library paths

FindOpenGLES.cmake, line 29
#MS compiler - todo - fix the following line:
SET (OPENGLES_gl_LIBRARY ${OGRE_SOURCE_DIR}/Dependencies/lib/release/libgles_cm.lib CACHE STRING "OpenGL ES 1.x library for win32")
should be
#MS compiler - todo - fix the following line:
SET (OPENGLES_gl_LIBRARY ${OGRE_DEPENDENCIES_DIR}/lib/release/libgles_cm.lib CACHE STRING "OpenGL ES 1.x library for win32")
FindOpenGLES2.cmake, line 33
#MS compiler - todo - fix the following line:
SET (OPENGLES_gl_LIBRARY ${OGRE_SOURCE_DIR}/Dependencies/lib/release/libGLESv2.lib CACHE STRING "OpenGL ES 2.x library for win32")
should be, I think:
#MS compiler - todo - fix the following line:
SET (OPENGLES2_gl_LIBRARY ${OGRE_DEPENDENCIES_DIR}/lib/release/libGLESv2.lib CACHE STRING "OpenGL ES 2.x library for win32")
Also the EGL library is not included in Win32, but the emulator supports it.

When compiling I run into these thing:

1

2>..\..\..\..\RenderSystems\GLES\src\OgreGLESHardwarePixelBuffer.cpp(252): error C2668: 'pow' : ambiguous call to overloaded function
2> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h(583): could be 'long double pow(long double,int)'
2> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h(535): or 'float pow(float,int)'
2> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h(497): or 'double pow(double,int)'
2> while trying to match the argument list '(int, GLint)'
2>..\..\..\..\RenderSystems\GLES\src\OgreGLESHardwarePixelBuffer.cpp(253): error C2668: 'pow' : ambiguous call to overloaded function
2> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h(583): could be 'long double pow(long double,int)'
2> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h(535): or 'float pow(float,int)'
2> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\math.h(497): or 'double pow(double,int)'
2> while trying to match the argument list '(int, GLint)'


Please commit this to RenderSystems\GLES\src\OgreGLESHardwarePixelBuffer.cpp, line 251 to solve the ambiguity.
// Calculate the width and height of the texture at this mip level
mWidth = mLevel == 0 ? width : width / pow(2.0f, level);
mHeight = mLevel == 0 ? height : height / pow(2.0f, level);
2

A bunch of undeclared '__PRETTY_FUNCTION__'. In which Dependency is this supposed to be defined?
RenderSystems\GLES2\src\EGL\OgreEGLContext.cpp(81): error C2065: '__PRETTY_FUNCTION__' : undeclared identifier

In case it's not on WIN32. Maybe switch it off?: RenderSystems\GLES2\src\OgreGLES2Prerequisites.h, line 130
#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32)
#define ENABLE_GL_CHECK 0
#else
#define ENABLE_GL_CHECK 1
#endif
or better use the Ogre logging/exceptions?

3

1>OgreGLSLESLinkProgram.obj : error LNK2001: unresolved external symbol __imp__glProgramBinaryOES@16
1>OgreGLSLESLinkProgram.obj : error LNK2001: unresolved external symbol __imp__glGetProgramBinaryOES@20

This is not supported in the emulator. In the dependencies gl2ext.h should say
#define GL_OES_get_program_binary 0
instead of
#define GL_OES_get_program_binary 1
. Not really an Ogre problem but maybe a preprocessor hint?