-
Notifications
You must be signed in to change notification settings - Fork 5
Renderer
At runtime the instance of RenderAdapter is used as the bridge between the renderer and the UI widget (ie. PyQt QWidget) it renders into. The RenderAdapter and getRenderAdapter()
declarations in RenderTypes.pxd are given here:
cdef cppclass RenderAdapter:
u64 createWindow(int width, int height) except+
void paint()
void resize(int x, int y,int width, int height)
RenderScene* getRenderScene()
RenderAdapter* getRenderAdapter(Config* config) except+
When the widget is instantiated, getRenderAdapter()
is called with a Config
object provided which will be retained by the returned RenderAdapter
object.
When the window is ready to be initialized a value identifying the window is stored in Config
under the RenderParamGroup and name "parentWindowHandle" or "externalWindowHandle" depending on the platform:
- Windows: parent window ID number in "parentWindowHandle"
- Linux: D:S:W in "parentWindowHandle" where D is the display number, S the screen number, and W the window ID number
- OSX: window ID number in "externalWindowHandle"
Once this is done createWindow()
is called passing in the widget's current dimensions.
This instantiates the renderer with the given window parameters and returns the ID number of the internal window object.
Other parameters used by the renderer are:
- logfile: path of the logfile to write renderer output to
- vsync: whether to use vsync or not, value is true or false