Visual Studio template for cross-platform OpenGL development


Today the Visual Studio team shipped a project template for cross-platform graphics development.  This uses the Visual Studio shared project mechanism to target the Windows Universal Platform, Android, and iOS, with identical OpenGL ES 2.0 rendering code shared across all three platforms.

I’m posting this here partly because I think it is cool, but more importantly because I had a hand in making it happen.  In order to run portable GL rendering code on Windows, this template uses a version of ANGLE that is maintained by my team.  When you compile it for Windows, Visual Studio will automatically pull down our ANGLE binaries from NuGet.

 

The Visual Studio project looks like so:

 

 

Let’s be honest, this is not the most visually exciting graphics demo ever 🙂  But hey, just insert some different draw calls, different GLSL shaders, different vertices, maybe a few textures, and you could make it draw something far more interesting!


Comments (6)

  1. Steveo says:

    It uses OpenGL, so does it work on Mac or Linux?

  2. The rendering code is standard OpenGL ES 2.0, which is not quite the same as the non-ES OpenGL used on Mac and Linux but mostly compatible.  The template itself (project files, app entrypoint, window creation etc.) just targets the three platforms I listed above though.

  3. Yoav from DuoCode says:

    Shawn – this is awesome! Seems like a great match for using it with DuoCode (http://duoco.de/) to have a cross-platform GL ES code that also compiles to WebGL!

  4. More details about cross-platform code sharing directly from the Visual C++ team: blogs.msdn.com/…/cross-platform-code-sharing-with-visual-c.aspx

  5. Ram says:

    This is cool! OpenGL ES 2.0 across all 3 platforms. I like DirectX but having a shared codebase is a big win and C++

    on all 3 platforms is almost as big. Objective-C and Java just aren't there for performant games and simulations.

  6. Jared says:

    Crashes for me when trying to create the project.

Skip to main content