Custom Window Manager

Gsage Engine allows you to implement new windowing managers.
Current main windowing system is SDL.
WindowManager is optional, it is possible to let render system create windows on it’s own.

Steps to register new WindowManager:

  1. Inherit Gsage::WindowManager interface. Implement abstract methods:

    • Gsage::WindowManager::initialize().

    • Gsage::WindowManager::createWindow().

    • Gsage::WindowManager::destroyWindow().

  2. Inherit Gsage::Window interface. Implement abstract methods:

    • Gsage::WindowManager::getWindowHandle() should return native OS window handle.

    • Gsage::WindowManager::getGLContext() should return open GL pointer. Return 0 if not needed.

  3. Add register, unregister methods in the plugin:

...

bool MyPlugin::installImpl() {
  mFacade->registerWindowManager<MyWindowManager>("MyWindowManager");
  return true;
}

...

void MyPlugin::uninstallImpl() {
  mFacade->removeWindowManager("MyWindowManager");
}
  1. Make Gsage load the Plugin and switch to the new WindowManager:

...
"windowManager": {
  "type": "MyWindowManager"
}

...
"plugins":
[
...
"MyPlugin"
...
]