Posts RSS Comments RSS Del.icio.us Digg Technorati Blinklist Furl reddit 68 Posts and Comments till now
This wordpress theme is downloaded from wordpress themes website.

OpenGL 3+ & OpenGL ES 2.0+ style (with VAO’s)

I upgrade my project to a more modern style of OpenGL API calls.  Here’s a screen shot using OpenGL ES 2.0 with an extension to enable VAO’s (glBindVertexArrayOES, glDeleteVertexArraysOES, glGenVertexArraysOES, glIsVertexArrayOES) on my Nexus 7 (using DroidAtScreen).  And the same source code compiled to run on Windows 7, Mac OS X.  It draws a triangle and a cube using VBO’s, IBO’s, VAO’s (vertex buffer objects, index buffer objects, vertex array objects).

image_thumb[30] image image image

Although my OpenGL 2 version worked on Ubuntu Linux in VMware Player, I had some trouble getting my VMware Player to work with Ubuntu for OpenGL 3+.  I think this is due to lack of support by VMware.  I tried installing the latest Mesa release (Mesa 10.0), which implements OpenGL 3.3 API.  I thought maybe the Mesa software rendering mode would work for OpenGL 3.3.  My VMware Ubuntu install glxinfo still reports only support for OpenGL 2.0.  However, I don’t think that’s the case.  Mesa3d.org doc says:

http://www.mesa3d.org/relnotes/10.0.html
> Mesa 10.0 implements the OpenGL 3.3 API, but the version reported by glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used. Some drivers don’t support all the features required in OpenGL 3.3. OpenGL 3.3 is only available if requested at context creation because compatibility contexts are not supported.

Virtual Machines have a history of limited support for OpenGL & DirectX, especially on a Linux guest.  Windows Remote Desktop was also unable to support hello world OpenGL 3+ (although VNC might work).

Part of the educational value (and fun) of this project is to get some exposure to software development on other platforms (via cross-platform software development), so I’d like my little SDL2 OpenGL project to at least run on (Windows 7+, Mac OS X, Linux Ubuntu, iOS, Android).  So I might try dual-booting, or even just buying a separate cheap computer to run Ubuntu Linux with OpenGL 4.x.

First I ported my OpenGL 2 style code to OpenGL 3+ (4) style and got the Windows version to work, then the Mac OS X version.  Then I tried it on Linux (and ran into the VMware issue).  Then I got it to work on Android, which required some hacking.  Build uses API Level 18.  Use SDL_RWFromFile() to read vertex & fragment shaders from Android assets.  Use a separate GLSL vertex & fragment shader for Windows (in, out) vs. Android (attribute, varying).  Then I got it to work on iOS, which did not require much additional hacking.  Like on Android, for iOS I had to add my shaders folder (GLSL text files) via Project -> Build Phases -> Copy Bundle Resources –> add “shaders” folder.

Edit 2013/12/14: a couple notes on my setup.  I’m going to put together a Linux (Ubuntu) computer rather than rely on VMWare.  I also found that although Microsoft Remote Desktop does not support newer versions of OpenGL, I found that NoMachine (NX) does (I tried Windows to Windows).

Trackback this post | Feed on Comments to this post

Leave a Reply