Creating the Application Skeleton#

The easiest way to create a new application is to copy an existing one. For example, using IntroducingPVRUtils:

  1. Add the SDK folders framework/ and include/ as include folders.

  2. Link against PVRShell, PVRCore, PVRAssets, and either PVRUtilsVk****(PVRUtilsVk.lib) or PVRUtilsGles****(PVRUtilsGles.lib).

  3. Link if needed:

    • If using Vulkan, the application should also link against PVRVk (PVRVk.lib).

    • If using OpenGL ES, there is no need to link against OpenGL ES libraries. DynamicGles.h takes care of loading the functions at runtime.

  4. Include PVRShell.h and one of PVRUtilsVk.h or PVRUtilsGles.h in the file where the application class is located.

  5. Create the application class, inheriting from pvr::Shell, implementing the five mandatory callbacks as follows:

    class MyApp : public pvr::Shell
    {
        //...Your class members here...
        pvr::Result::initApplication();
        pvr::Result::initView();
        pvr::Result::renderFrame();
        pvr::Result::releaseView();
        pvr::Result::quitApplication();
    }
    
  6. Create a free-standing newDemo() function implementation with the signature std::unique_ptr<pvr::Shell> newDemo() that instantiates the application. The Shell uses this to create the application. Use default compiler options such as calling conventions for it.

    std::unique_ptr<pvr::Shell> newDemo()
    {
        return std::make_unique<MyApp>();
    }