OpenGL ES 2.0 - glut replacement

I’m developing a game using OpenGL ES 2.0, so I need a glut replacement to use with it (my main requirements are for a main loop and keyboard, gamepad and mouse handling).

This is for a university project and nominally is cross-platform, in reality I’m developing principally for PC but using OpenGL ES 2.0 while trying to be as platform neutral as possible (with the exception of wanting mouse and gamepad control :slight_smile: ).

So far my only alternatives seem to be glut-es or openkode.

Are there any other alternatives? Does anyone have any recommendations? Would SDL work?

Any help with this would be most appreciated.



The answer is kind of ugly.

  1. There is SDL 1.3 … sort of… last time I checked, it only builds a OpenGL ES 1.x context. The main point here is IF you want to run on iPhone/iPad/iPod, the Apple protable platform does NOT use EGL to create GLES contexts, it uses a very Apple specific API.

  2. if you are developing for a Windows Mobile or Unix-ish mobile platform (like Maemo/Meego) you can use SDL1.2 to get you events and make your window and then use EGL to build the GLES2 context. Actually under Maemo there is a very small and simple library to build a GLES 1.x or 2.x context in one’s SDL1.2 windows, SDL_gles… that library (get it via apt-get source in scratchbox) actually does not care if the platform is Maemo… it uses EGL and works if your platform has SDL1.2 and has EGL. The library has issues in how it deals with multiple contexts, but as long as you only need 1 context it is fine… or you can look at it source code (it is tiny) to see how to use EGL with SDL1.2, this is the path I recommend.

On the subject of GLUT|ES, the home page says about OpenGL ES 1.x, nothing about 2.x… maybe that has changed and not yet documented on the webpage, though, you could edit the source code’s EGL bits to make a GLES 2.0 context…

I do NOT recommend the next one, but for completeness: Qt. Qt is on Maemo/Meego, Linux, MS-Windows and Mac OS-X (but not any portable Apple platform). What GLES you get with Qt depends on how Qt was built… beware. as for Qt on Windows Mobile, no clue.

By the way, unless you have installed emulation libraries, you are not going to have GLES (1.x or 2.x) on a PC.

Thanks for getting back to me. Your response sort of confirms my suspicions.

I fear that glut-es is a non-starter, but I’ve found a couple of implementations of OpenKode and EGL which I’ll have to experiment with.

I’m working through the OpenGL® ES 2.0 Programming Guide so I’ll try to use what they use, my main concern being that the emulation library they use (AMD) is no longer supported.

I’m using an emulation library (Mali) which works well on XP but I’ve yet to try it with Win7.