Porting OpenGL ES applications to the Windows Store

    If you have a ready-made application developed using OpenGL ES, and you thought about porting it to the Windows Store, then I have good news for you. The Microsoft Open Technologies team has recently been working on adapting the ANGLE project for the Windows Store and Windows Phone Store. This means that the code based on OpenGL ES 2.0 that you have already written can be reused, and your Windows Store application can be released faster.

    What is ANGLE.

    Almost Native Graphics Layer Engine is a Google-developed OpenGL ES wrapper on top of DirectX 9-11. ANGLE is used as the main WebGL backend for Google Chrome and Mozilla Firefox on the Windows platform. Chrome also uses ANGLE for all rendering operations on Windows, including Canvas2D hardware acceleration and support for Native Client graphics operations.

    ANGLE for Windows Store Apps

    The main API for working with graphics on the Windows Store Apps and Windows Phone Store Apps platforms is DirectX. This API is the main one for the platform, has become part of the operating system, and has proven itself in many applications. But if you already have an application developed using OpenGL ES, then porting it to DirectX will require obvious costs. In order to facilitate this task, the Microsoft Open Technologies team prepared the fork of ANGLE (it is likely that it will soon become part of the main ANGLE branch) which allows you to save most of the OpenGL ES code on Windows RT and Windows Phone 8.0. Using this port, the Cocos2D-X library has already been successfully ported to Windows RT .

    Where to start and some technical points

    The source fork files are located at https://github.com/stammen/angleproject . After downloading, open the file \ samples \ RotatingCube \ RotatingCube_winrt_2013.sln in Visual Studio 2013. This is an example from which all aspects of the organization of the OpenGL application infrastructure for the Windows Store become clear.
    The main entry point for WinRT is the Windows :: ApplicationModel :: Core :: IFrameworkView class, just like DirectX applications. The RotatingCube :: Run () method is the main message processing and rendering loop.
    The CubeRenderer class is the main class for working with graphics; it implements initialization methods (CreateResources ()) and display image frames on the screen (Update ()).
    It should also be borne in mind that Windows 8.0 and Windows Phone 8.0 do not have a shader compilation API at runtime. It is necessary to prepare shader blobs in advance. There are no such restrictions in Windows 8.1, and you can use dynamic shaders.
    If you do not yet have a general idea of ​​developing for the Windows Store, I highly recommend starting with a study of the application architecture and an example application for DirectX .

    Also popular now: