Cross-platform renderer in OpenGL ES

Started by
2 comments, last by bubu LV 12 years, 2 months ago
[color=#000000][font=Arial,]
I'm writing an cross-platform renderer. I want to use it on Windows, Linux, Android, iOS.[/font][color=#000000][font=Arial,]
Do you think that it is a good idea to avoid absolute abstraction and write it directly in OpenGL ES 2.0?[/font][color=#000000][font=Arial,]
As far as I know I should be able to compile it on PC against standard OpenGL, with only a small changes in code that handles context and connection to windowing system.[/font]
Student of computer graphics and 2K Czech - Junior programmer
Advertisement
I am doing exactly this with my 'barebones' skeleton for my Ludum Dare entries. That'll be on github this weekend.

I am using only that subset of OpenGL that is OpenGLES compatible, i.e. all shaders and attribute arrays. My utility code to compile a shader, for example, sometimes puts a "precision lowp float;" on the front before compiling etc; that kind of platform adaption. The game code is 100% and portable.

Because I'm keen to compile for Google Native Client too, I'm having to abstract file io and make it all async; that's the biggest deal.

http://williamedwardscoder.tumblr.com/post/16108484818/competition-mini-ludum-dare-21st-22nd-jan-2012
http://www.ludumdare.com/compo/2012/01/19/an-excited-first-time-jam-team-cant-wait-for-the-weekend-minild31/
Imgtek PowerVR SDK has a pretty good ES 2.0 abstraction layer for Windows, and it is fast because it literally piggybacks on the actual OpenGL driver provided by the system. There is also linux port of the SDK, but I haven't tried that myself. Anyway, if you want make sure that your project complies with the ES 2.0 spec, PowerVR SDK is a good way to go. Bonus, the SDK will actually load textures in PVR compression format, the same used on iOS devices. Which means you can implement a large part of your game engine core under Windows then cross compile to iOS, if needed. Also, debugging is faster too.
Latest project: Sideways Racing on the iPad
You can use standard OpenGL on desktop. But to be better sure that your application will run on mobile devices you can use OpenGL ES API as Tachikoma suggests.
There are quite a fewdifferent OpenGL ES 2.0 abstraction layers/emulators for Windows from different vendors of mobile GPUs:
On Linux most likely you will want to use libmesa-gles2.

I myself like and use Google ANGLE to develop my app on Windows. After that I can run app on Android without changing any of rendering code.

This topic is closed to new replies.

Advertisement