Factory class for Game instances. Sets services, GraphicsDevice, AudioEngine, PhysicsEngine, etc...
More...
#include <GameFactory.hpp>
Factory class for Game instances. Sets services, GraphicsDevice, AudioEngine, PhysicsEngine, etc...
A Game instance can still be constructed without this, but it will fallback to provided defaults.
◆ FnCreateGraphicsDevice
| typedef std::unique_ptr< Graphics::IGraphicsDevice >(* Engine3DRadSpace::GameFactory::FnCreateGraphicsDevice) (void *hwnd, size_t x, size_t y) |
◆ GameFactory() [1/3]
| GameFactory::GameFactory |
( |
| ) |
|
◆ GameFactory() [2/3]
| Engine3DRadSpace::GameFactory::GameFactory |
( |
const GameFactory & | | ) |
|
|
delete |
◆ GameFactory() [3/3]
| Engine3DRadSpace::GameFactory::GameFactory |
( |
GameFactory && | | ) |
|
|
delete |
◆ AddService()
| void GameFactory::AddService |
( |
std::unique_ptr< IService > && | service | ) |
|
Adds an service to the game instance.
- Parameters
-
◆ Begin() [1/2]
| void GameFactory::Begin |
( |
const std::string & | title, |
|
|
size_t | width, |
|
|
size_t | height ) |
Begin Game instance creation.
- Parameters
-
| title | Title of the window. |
| width | Width of the window. |
| height | Height of the window. |
◆ Begin() [2/2]
Begin Game instance creation.
- Parameters
-
| window | Window instance to use for the game. The game instance will own the window. |
◆ CreateGame()
| std::unique_ptr< Game > GameFactory::CreateGame |
( |
| ) |
|
Creates the game application instance. Must be called after Begin().
- Returns
- a new Game instance
◆ CreateGraphicsDevice()
| std::unique_ptr< Graphics::IGraphicsDevice > GameFactory::CreateGraphicsDevice |
( |
const std::string & | name, |
|
|
void * | hwnd, |
|
|
size_t | x, |
|
|
size_t | y ) |
|
static |
Creates a Graphics device.
- Parameters
-
| name | Named backend. If empty, first element in _deviceCtors is called. |
- Returns
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ RegisterDevice()
Registers a new graphics device type for this factory class.
- Parameters
-
| name | String name representation |
| fn | Function pointer to a function that creates a new concrete instance of IGraphicsDevice |
◆ SetFallbackGraphicsDeviceCtor()
Sets the fallback graphics device constructor. This is used if no named backend is specified or if the named backend is not found.
- Parameters
-
| fn | Function pointer to the graphics device constructor. |
The documentation for this class was generated from the following files: