What is PVRShell?

PVRShell provides a basic structure for developing Vulkan and OpenGL ES applications

About PVRShell

PVRShell, and particularly the pvr::Shell class, is the scaffolding of an application. It implements the entry point (main) of the application and provides convenient stubs to immediately start coding application logic.

It is intended for the main structure of an application to be a class implementing pvr::Shell as seen in Creating a Typical Framework 5.x Application. This way, all of the per-platform initialisation (creating the window, reading command line parameters, calling a function at initialisation, every frame, and teardown) is taken care of. Every conceivable platform operation such as loading files from device-specific storages is provided.

Its public contents can easily be accessed from inside the application class itself. The application class normally derives from the pvr::Shell class, and is powered by its callbacks. So in most IDEs, after writing this-> somewhere in the main application class, autocomplete should give all the information needed to be able to use PVRShell.

PVRShell handles everything up to the level of display/window creation. Higher levels, for instance GPU contexts/devices/API calls/surfaces including any and all API objects, are not handled by the shell. These should be dealt with from the application, normally using PVRUtilsVK/PVRUtilsGles.

In summary, PVRShell:

  • abstracts away the platform - display, input, filesystem, window and so on
  • contains main() or any other platform-specific entry point of the application
  • is the ticking clock that provides all the events that structure the application
  • provides utilities for reading command line parameters, loading and saving files, displaying the FPS and many others
  • catches std::runtime_error exceptions. All the exceptions used in the Framework derive from std::runtime_error. The message is displayed in a platform-specific way, usually a dialog window.

How to use PVRShell

PVRShell uses PVRCore and therefore transitively links it in the application.

  1. Add the PVRShell target from CMakeLists.txt.
  2. Include PVRShell/PVRShell.h in the main application class file.
  3. Create a class that derives from pvr::Shell as described in The Skeleton of a Typical Framework 5.x Application to begin using the shell. The library file will be named PVRShell.lib or equivalent libPVRShell.a.