Class PAL
Defined in File PAL.hpp
Class Documentation
-
class PAL
Platform abstraction layer for managing platform-specific behavior.
Warning
This class is only for engine use. While it is documented, no clients should use this class
Public Functions
-
void SetModule(const std::string &mod)
Set the active module.
- Parameters:
mod – The name of the new module to use
- Throws:
NonexistentValueException – If the requested module does not exist
BadValueException – If the requested module is incompatible with the platform
MiscException – If there are still PAL-backed objects using a different module
-
bool InitializeModule()
Attempt to initialize the active module.
- Throws:
NonexistentValueException – If there is no active module
BadInitStateException – If the module has already been initialized
- Returns:
Whether initialization succeeds
-
void GfxConnect()
Connect the window and graphics backend.
- Throws:
NonexistentValueException – If there is no active module
BadInitStateException – If the module has not been initialized
BadStateException – If the graphics backend and window are already connected
-
void GfxDisconnect()
Disonnect the window and graphics backend.
- Throws:
BadStateException – If the graphics backend and window are not connected
-
void TerminateModule()
Shutdown the active module.
- Throws:
BadInitStateException – If the module has not been initialized
BadStateException – If the graphics backend and window are still connected
-
template<typename T>
void ConfigureImplPtr(T &obj) = delete Configure the implementation pointer for a PAL-backed object.
Loads the implementation pointer with an interface object from the active module
- Throws:
BadInitStateException – If the module has not been initialized
BadStateException – If the graphics backend and window are not connected
Public Static Functions
-
static PAL &Get()
Get the instance and create one if there isn’t one.
- Returns:
The instance
-
void SetModule(const std::string &mod)