Target the desktop and mobile devices?

Hi All,

I am just learning about OpenGL ES. I was wondering if it’s possible to write an application that would work both on the desktop and on mobile devices just by switching out headers and recompiling. I realize there are some differences in OpenGL vs. ES APIs, but if you just used the ES subset and switched out the headers, is it possible? It seems it wouldn’t be possible ( or at least not easy ) to do this with JOGL-ES, since they use different package names and even different class names, but it looks like the C implementation used all the same names and namespaces. Any thoughts on this?

many thanks,


You can compile your OpenGL ES on Desktop but, you need use an implementation of the OpenGL ES for Desktop, you cant use OpenGL.

OpenGL ES is based on OpenGL. OpenGL ES functionalities can be considered a subset of the OpenGL functionalities but that doesnt mean that you will compile the OpenGL ES using OpenGL.

If you wanna use the OpenGL on desktop, you can change the function calls. Since the functionalities is a subset, you may change one OpenGL ES method for one with equal functionality in OpenGL.

My current implementation using OpenGL ES is compiled to Nokia S60 and PocketPC… but both used OpenGL ES implemenations.

*sorry for my english.

I compiled my OpenGL ES project to OpenGL/Win32… and the only method i had to change was

glClearDepthf to glClearDepth

*ps: i believe was easy since im not using any fixed-point math.

Hmmmm… maybe I’m not being clear. I understand you cannot use OpenGL to build for OpenGL ES. That’s not what I’m asking.

Let’s say I build an app for a mobile device using OpenGL ES. Now I want to run this same app on the desktop. Can I simply switch out the headers ( to OpenGL ) and rebuild it? It seems the function calls are the same ( a subset I know ). Does it make sense?



Funny… we were replying at the same time.

Yeah… that’s what I was wondering. You have answered my question!

That’s pretty cool. As I said, that’s something you really can’t do with JOGL/JOGL - ES if you’re going the Java route. This is a pretty nice advantage I think.

glClearDepthf to glClearDepth

P.S. But even this you could get around with a compiler directive. :smiley:

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.