Common code base between Desktop and Mobile

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Common code base between Desktop and Mobile

AlanObject
I am just starting with OpenGL with a new project, and was referred over to this forum from StackOverflow by goussej.  I am at the point where I have some of the tutorials working.

My application (a game) is intended to have a desktop version and a mobile version and I wanted to preserve code base as much as possible between the the platforms.   The plan is to debug everything in Netbeans/Java using JOGL, then for iOS hand transcribe the Java version into Obj-C.  

So the OpenGL question is how do I design using the OpenGL ES 2.0 API on the desktop?  Does MacOS and Windows support it or is it a function of what graphics chip/driver is loaded?

I found this web page fairly informative, particularly the following figure:

2.0 to 2.0 ES

If I am reading this correctly, this means that the logic flow for the 2.0 and and ES 2.0 will be substantially different, and I am looking for a way around this.
Reply | Threaded
Open this post in threaded view
|

Re: Common code base between Desktop and Mobile

gouessej
Administrator
Hi

Nice schema :)

You can use different code paths depending on tests (isGL2ES2(), ...). If your code uses only methods in GL2ES2, it will work on almost all modern devices. Some drivers provide ES support in desktop environments, I can confirm it works really good under GNU Linux, this is what I do to test my code with OpenGL ES.

If you use only VBOs and VAOs with shaders, most of your code should work with OpenGL 2 and OpenGL ES 2.

I remind you that LibGDX has a JOGL backend and supports iOS.
Julien Gouesse | Personal blog | Website