So I've been working on porting Irrlicht to WebOS. It's an interesting beast -- they support OpenGL ES 1.1 and 2.0, and use SDL for their drawing surface creation and input. They say they've extended SDL with OpenGL ES 1.1 and 2.0 support.
Now, before I go any further, please keep in mind I did C++ about 8 years ago, and my background and this point is C#. I'm NOT an OpenGL guru, or even moderately proficient user. So please forgive me if I blabber out something really dumb.
That said, what I did was grab the OpenGL ES branch of Irrlicht, and configure it out to compile against SDL. (_IRR_COMPILE_WITH_SDL_DEVICE_). Although my first testcase is on windows, I've specifically disabled _IRR_COMPILE_WITH_WINDOWS_DEVICE -- SDL should be able to handle Windows as far as I understand.
I then had to make a few modifications to CIrrDeviceSDL, specifically in the createDriver function to support OpenGL ES, like so:
Code: Select all
case video::EDT_OGLES1:
#ifdef _IRR_COMPILE_WITH_OGLES1_
{
video::SExposedVideoData data;
data.OpenGLWin32.HWnd=Info.window;
VideoDriver = video::createOGLES1Driver(CreationParams, data, FileSystem);
}
#else
os::Printer::log("No OpenGL-ES1 support compiled in.", ELL_ERROR);
#endif
break;
Code: Select all
#if defined(_IRR_COMPILE_WITH_OGLES1_)
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
#endif
#if defined(_IRR_WINDOWS_) && defined(_IRR_COMPILE_WITH_OGLES1_) && defined(_IRR_COMPILE_WITH_PALM_DEVICE_)
// Load the desktop OpenGL-ES emulation library
_dgles_load_library(NULL, proc_loader);
#elif defined(_IRR_WINDOWS_)
So that's all hopefully peachy. The problem I am running into happens a little later, inside COGLESTexture.cpp:40:
Code: Select all
glGenTextures(1, &TextureName);
My gut feeling is there's something wrong with the way I'm linking to the dgles library. (I'm using Palm's PDK version of the library.) I've ran their sample code that targets dgles2.0, and that appears to work fine; I haven't yet found samples that target 1.1, but I'm assuming they've tested this as well.
Any hints? Anything I should dig into? Any source files I can upload?
Thanks!