2.9.16
Coherent GT
A modern user interface library for games
Sample application framework

The sample application framework builds upon the Base Application Framework and extends it with game-specific code and also code that is common for the samples: e.g. initialization/deinitialization for Coherent GT.

You should have read the Base Application Framework page before continuing.

The sample framework contains:

  1. Unified math library (glm)
  2. First person camera
  3. Game object class
  4. Base Application class

Unified math library

The sample framework uses glm for cross-platform mathematical operations. You can check the manual at the official site

First person camera

The FPS camera provides means for moving around a 3D world and getting back view and projection matrices needed for rendering. It can be located in the Coherent/Samples/UI/C++/Common/Camera.cpp file.

The important methods for movement are Camera::AddMoveFlags and Camera::AddMouseDelta, which should be called whenever a key or mouse event occurs. Then, each frame the Camera::Update method is called, which updates the matrices and resets flags and deltas. Check Sample 03 - Input in 3D for basic usage.

Game object

The game object stores geometry and transformation for the object and can be tested for intersection with a ray. It can be located in the Coherent/Samples/UI/C++/Common/GameObject.cpp file.

Base Application

The base application is located in the Coherent/Samples/Application/Application.h file. It has a PlatformWindow and an IRenderer. The base application has virtual methods for all of the events that the PlatformWindow exposes. Those methods are bound to the events of the PlatformWindow and can be overridden to customize behavior.

The user should derive the ApplicationBase class and override the event handler functions, such as ApplicationBase::OnMouseEvent, ApplicationBase::OnKeyEvent, ApplicationBase::OnIdle, ApplicationBase::OnResize. The derived application should be created either globally, or in the main loop and then its Run method should be called. The overridden event handlers will then be called until the window is closed. For more information about the base application, please check out BaseApplication

Check one of the samples for example usage of the sample framework.