|
Wasabi
|
#include <WCore.hpp>
Public Member Functions | |
| template<typename T > | |
| T | GetEngineParam (std::string paramName, T fallback=T()) |
| template<typename T > | |
| void | SetEngineParam (std::string paramName, T value) |
| virtual WError | Setup ()=0 |
| virtual bool | Loop (float fDeltaTime)=0 |
| virtual void | Cleanup ()=0 |
| void | SwitchState (class WGameState *state) |
| WError | StartEngine (int width, int height) |
| virtual WError | Resize (uint32_t width, uint32_t height) |
| uint32_t | GetCurrentBufferingIndex () |
| VkInstance | GetVulkanInstance () const |
| VkPhysicalDevice | GetVulkanPhysicalDevice () const |
| VkDevice | GetVulkanDevice () const |
| VkQueue | GetVulkanGraphicsQeueue () const |
| VulkanSwapChain * | GetSwapChain () |
Public Attributes | |
| class WVulkanMemoryManager * | MemoryManager |
| class WSoundComponent * | SoundComponent |
| class WWindowAndInputComponent * | WindowAndInputComponent |
| class WTextComponent * | TextComponent |
| class WPhysicsComponent * | PhysicsComponent |
| class WRenderer * | Renderer |
| class WFileManager * | FileManager |
| class WObjectManager * | ObjectManager |
| class WGeometryManager * | GeometryManager |
| class WEffectManager * | EffectManager |
| class WShaderManager * | ShaderManager |
| class WMaterialManager * | MaterialManager |
| class WCameraManager * | CameraManager |
| class WImageManager * | ImageManager |
| class WSpriteManager * | SpriteManager |
| class WRenderTargetManager * | RenderTargetManager |
| class WLightManager * | LightManager |
| class WAnimationManager * | AnimationManager |
| class WParticlesManager * | ParticlesManager |
| class WTerrainManager * | TerrainManager |
| WTimer | Timer |
| float | FPS |
| float | maxFPS |
| class WGameState * | curState |
| bool | __EXIT |
Protected Member Functions | |
| virtual VkInstance | CreateVKInstance () |
| virtual int | SelectGPU (std::vector< VkPhysicalDevice > devices) |
| virtual VkPhysicalDeviceFeatures | GetDeviceFeatures () |
| virtual WError | SetupRenderer () |
| virtual class WTextComponent * | CreateTextComponent () |
| virtual class WSoundComponent * | CreateSoundComponent () |
| virtual class WWindowAndInputComponent * | CreateWindowAndInputComponent () |
| virtual class WPhysicsComponent * | CreatePhysicsComponent () |
| void | _DestroyResources () |
Protected Attributes | |
| VkInstance | m_vkInstance |
| VkPhysicalDevice | m_vkPhysDev |
| VkDevice | m_vkDevice |
| VkQueue | m_graphicsQueue |
| VulkanSwapChain | m_swapChain |
| bool | m_swapChainInitialized |
| VkDebugReportCallbackEXT | m_debugCallback |
| std::map< std::string, void * > | engineParams |
Main application class. This class is abstract and one must implement its three methods (Setup, Loop and Cleanup) to be able to run the engine.
|
protected |
Destroys all resources of the engine.
|
pure virtual |
This function must be implemented by an application. It is called by the engine to give the application a last chance to clean up its resources before the engine exits.
Implemented in BulletDebugger.
|
protectedvirtual |
This function can be overloaded by the application. This function is called by the engine in StartEngine() and will give the application a chance to set the physics component of the engine. Default implementation will return null. IMPORTANT: You must fully initialize the returned component, be it with ::Initialize() or any other required initialization.
Reimplemented in BulletDebugger.
|
protectedvirtual |
This function can be overloaded by the application. This function is called by the engine in StartEngine() and will give the application a chance to set the sound component of the engine. Default implementation will return null. IMPORTANT: You must fully initialize the returned component, be it with ::Initialize() or any other required initialization.
|
protectedvirtual |
This function can be overloaded by the application. This function is called by the engine in StartEngine() and will give the application a chance to set the text component of the engine. Default implementation will create a WTextComponent.
|
protectedvirtual |
Creates and initializes a VkInstance to use in the engine.
|
protectedvirtual |
This function can be overloaded by the application. This function is called by the engine in StartEngine() and will give the application a chance to set the window/input component of the engine. Default implementation will create the appropriate component based on the OS. IMPORTANT: You must fully initialize the returned component, be it with ::Initialize() or any other required initialization.
| uint32_t Wasabi::GetCurrentBufferingIndex | ( | ) |
This simply returns Renderer::GetCurrentBufferingIndex()
|
protectedvirtual |
Can be overloaded by the application. This function should return the Vulkan features required by the application.
| VulkanSwapChain* Wasabi::GetSwapChain | ( | ) |
Retrieves the currently used swap chain.
| VkDevice Wasabi::GetVulkanDevice | ( | ) | const |
Retrieves the virtual device that the engine is using.
| VkQueue Wasabi::GetVulkanGraphicsQeueue | ( | ) | const |
Retrieves the currently used Vulkan graphics queue.
| VkInstance Wasabi::GetVulkanInstance | ( | ) | const |
Retrieves the Vulkan instance.
| VkPhysicalDevice Wasabi::GetVulkanPhysicalDevice | ( | ) | const |
Retrieves the Vulkan physical device that the engine is using.
|
pure virtual |
This function must be implemented by an application. It is called by the engine every frame to allow the application to update its state.
| fDeltaTime | The step time for this frame (roughly 1 / FPS) |
Implemented in BulletDebugger.
|
virtual |
This function can be overloaded by the user. This function is called by the engine when the window size changed. An overloaded implementation must call Wasabi::Resize(width, height) to allow the engine to also perform its internal resizing procedure.
| width | New window width |
| height | New window height |
|
protectedvirtual |
This function can be overloaded by the application. This function gives the application a chance to select the physical device (A graphics card) from the list available to Vulkan. This function is called by the engine during StartEngine() and the selected physical device will be used.
| devices | The list of available physical devices |
|
pure virtual |
This function must be implemented by an application. It is called after WInitialize and is supposed to call StartEngine() and initialize application resources.
Implemented in BulletDebugger.
|
protectedvirtual |
This function can be overloaded by the application. This function is called by the engine in StartEngine() and will give the application a chance to setup renderer of the engine. Default implementation will call WInitializeDeferredRenderer().
Reimplemented in BulletDebugger.
| WError Wasabi::StartEngine | ( | int | width, |
| int | height | ||
| ) |
This function must be called by the user before any Wasabi resources are initiated/created. This function must be called during the application's Setup(). This function will start the engine, initializing all its resources and components.
| width | Width of the window when the engine starts |
| height | Height of the window when the engine starts |
| void Wasabi::SwitchState | ( | class WGameState * | state | ) |
Switches the game state from the current state to the provided state. The previous state will have its Cleanup() method called, and the new state will have its Load() method called. The game states should be allocated by the user.
| state | The new game state |
| bool Wasabi::__EXIT |
When set to true, the engine will exit asap
| class WAnimationManager* Wasabi::AnimationManager |
Pointer to the animation manager
| class WCameraManager* Wasabi::CameraManager |
Pointer to the camera manager
| class WGameState* Wasabi::curState |
Current game state
| class WEffectManager* Wasabi::EffectManager |
Pointer to the effect manager
|
protected |
A map of various parameters used by the engine. Built-in parameters are:
| class WFileManager* Wasabi::FileManager |
Pointer to the file manager
| float Wasabi::FPS |
Current FPS, set by the engine
| class WGeometryManager* Wasabi::GeometryManager |
Pointer to the geometry manager
| class WImageManager* Wasabi::ImageManager |
Pointer to the image manager
| class WLightManager* Wasabi::LightManager |
Pointer to the light manager
|
protected |
Handle to the debugging callback created in debug mode
|
protected |
The used graphics queue
|
protected |
The swap chain
|
protected |
true if the swap chain has been initialized yet, false otherwise
|
protected |
The used Vulkan virtual device
|
protected |
The Vulkan instance
|
protected |
The used Vulkan physical device
| class WMaterialManager* Wasabi::MaterialManager |
Pointer to the material manager
| float Wasabi::maxFPS |
Maximum FPS the engine should reach, can be set by the user, 0 sets no limit
| class WVulkanMemoryManager* Wasabi::MemoryManager |
Pointer to the vulkan memory manager
| class WObjectManager* Wasabi::ObjectManager |
Pointer to the object manager
| class WParticlesManager* Wasabi::ParticlesManager |
Pointer to the particles manager
| class WPhysicsComponent* Wasabi::PhysicsComponent |
Pointer to the attached physics component
| class WRenderer* Wasabi::Renderer |
Pointer to the attached renderer
| class WRenderTargetManager* Wasabi::RenderTargetManager |
Pointer to the render target manager
| class WShaderManager* Wasabi::ShaderManager |
Pointer to the shader manager
| class WSoundComponent* Wasabi::SoundComponent |
Pointer to the attached sound component
| class WSpriteManager* Wasabi::SpriteManager |
Pointer to the sprite manager
| class WTerrainManager* Wasabi::TerrainManager |
Pointer to the terrain manager
| class WTextComponent* Wasabi::TextComponent |
Pointer to the attached text component
| WTimer Wasabi::Timer |
A timer object, which starts counting when the application starts
| class WWindowAndInputComponent* Wasabi::WindowAndInputComponent |
Pointer to the attached window/input component
1.8.17