Pictel 2d 0.1
Game Engine Documentation
|
Engine state holder. More...
Public Member Functions | |
virtual Size | GetViewportSize ()=0 |
virtual void | SetViewportSize (Size, float)=0 |
virtual void | SetOnScreenSizeChangeHandler (std::function< void(Size, float)>)=0 |
Engine state holder.
Holds various information on the state of the engine. This should be used to setup an observer for the screen size change so that the game has a chance to react and, maybe, change the viewport size.
The default implementation should register for screen size change event via EngineStateI::SetOnScreenSizeChangeHandler and provide the wanted viewport size via EngineStateI::SetViewportSize.
The code below takes the screen size provided in the handler and calcualtes and scale for the game leaving the viewport size unchanged.
|
pure virtual |
Returns the viewport width and height. This is the desired viewport size and controls the size of the framebuffer texture. Is reflects what was set during initialization and what was modified throughout the course of the engine lifcycle.
|
pure virtual |
Registers a screen size change. Once the screen size is changed this function will be callsed and the script will have an option to modify the desired viewport. That in turn might recreate the framebuffer texture size.
The lambda will receive the parameters:
|
pure virtual |
Set the viewport & scale. This changes the target framebuffer texture size on the frame.