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
:
Inherit
Gsage::WindowManager
interface. Implement abstract methods:Gsage::WindowManager::initialize()
.Gsage::WindowManager::createWindow()
.Gsage::WindowManager::destroyWindow()
.
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.
Add register, unregister methods in the plugin:
...
bool MyPlugin::installImpl() {
mFacade->registerWindowManager<MyWindowManager>("MyWindowManager");
return true;
}
...
void MyPlugin::uninstallImpl() {
mFacade->removeWindowManager("MyWindowManager");
}
Make Gsage load the Plugin and switch to the new WindowManager:
...
"windowManager": {
"type": "MyWindowManager"
}
...
"plugins":
[
...
"MyPlugin"
...
]