Sign in to follow this  
SkylerBubier

Cross-Platform and OpenGL ES

Recommended Posts

I have been using C# and XNA for a while, but I'm looking to make a totally new approach on game development; cross-platform using [b]C++[/b].

Doing some research, I have come across [b]OpenGL ES[/b], which seems to be a very portable API for game development. However, I don't know the first thing about this stuff! Every tutorial or book I find seems to be focused on iOS development OR Android development.

My target systems would be:
[b]Windows[/b], [b]Android[/b], [b]iOS[/b] and [b]MacOSX[/b], but would love to also support [b]Linux[/b] as well as Google Chrome using Google's [b]Native Client[/b].

My application that I would like to create will be very simple and will not technically require any 3D, but it will be a game. I don't mind and actually expect to individually write the core code, such as WinAPI or cocoatouch for input, etc. However, I'd really like to write as much as possible commonly in C++.

I own a Windows 7 Desktop, a Windows XP laptop, a Macbook Pro, an iPod Touch, and an Android phone. All suggestions are welcome to which approach I should go with as well as IDEs, but I would love to write the common code on the Windows systems.

Share this post


Link to post
Share on other sites
OpenGL GL 2.0 is somehow a subset of normal OpenGL. Well, not exactly but if you write openGL ES 2.0 code it will work also on Windows, Linux and OSX unless you use some extensions that are only found on mobile.

Share this post


Link to post
Share on other sites
I think what you want is to use the common subset of OpenGL ES 2.0 and OpenGL 4.0. Most platforms do not support both OpenGL and OpenGL ES except maybe if you're using the Mesa software renderer on GNU/Linux desktops (as opposed to Andoid/Linux devices).

GL context creation is entirely platform-specific. OpenGL ES was designed to work hand-in-hand with EGL (another Khronos group standard) for that purpose. Most desktop platforms use some native library to obtain a context. There are also cross-platform libraries like Qt and SDL 1.3/2.0 that will wrap and hide all that for you.

Share this post


Link to post
Share on other sites
I am developing a cross-platform graphics API abstraction that runs against D3D11, OpenGL3, GLES2 and WebGL ([url="https://dl.dropbox.com/u/40949268/Platforms.jpg"]gfxapi[/url], and its [url="https://dl.dropbox.com/u/40949268/code/gfxapi.html"]platform coverage matrix[/url]). OpenGL3, GLES2 and WebGL are so close to each other, that one can comfortably share the codebase for each. In my codebase there are minimal #ifdef cases for GLES2, mostly related to added checks for potentially unsupported features (e.g. non-pow2 mipmapping).

NaCl, iOS and Android all use GLES2, so you can get to a lot of platforms with the same API.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this