The Joe Engine
Joe's engine programming playground
|
The Engine Instance class. More...
#include <EngineInstance.h>
Public Member Functions | |
JEEngineInstance () | |
JEEngineInstance (RendererSettings rendererSettings) | |
Constructor. More... | |
~JEEngineInstance ()=default | |
Destructor (default). More... | |
void | Run () |
Run the main loop. More... | |
JEVulkanRenderer & | GetRenderSubsystem () |
Get the renderer subsystem. More... | |
JEIOHandler & | GetIOSubsystem () |
Get the IO subsystem. More... | |
Entity | SpawnEntity () |
User function - spawn an entity into the scene. More... | |
void | DestroyEntity (Entity entity) |
void | LoadScene (uint32_t id) |
template<typename T , typename U > | |
void | RegisterComponentManager () |
Register a component manager with the engine. More... | |
template<typename T , typename U > | |
const PackedArray< T > & | GetComponentList () const |
Get a particular component manager's list of components. More... | |
MeshComponent | CreateMeshComponent (const std::string &filepath) |
Create a mesh component with a specific path to a mesh file. Invokes a mesh loading function in the renderer. More... | |
uint32_t | LoadTexture (const std::string &filepath) |
Load a texture into the engine at a specific path. Invokes a function in the renderer. More... | |
void | CreateShader (MaterialComponent &materialComponent, const std::string &vertFilepath, const std::string &fragFilepath) |
Load a shader into the engine at a specific vertex/fragment filepath pair and store in the material component. More... | |
void | CreateDescriptor (MaterialComponent &materialComponent) |
Create a descriptor from the specified material component properties. Invokes a function in the renderer. More... | |
void | InstantiateParticleSystem (const JEParticleSystemSettings &settings, const MaterialComponent &materialComponent) |
Instantiate a particle system with specific settings in the scene. More... | |
template<typename T > | |
void | AddComponent (const Entity &entity) |
template<typename T , typename U > | |
T * | GetComponent (const Entity &entity) const |
Get the component attached to an entity. More... | |
template<typename U , typename T > | |
void | SetComponent (const Entity &entity, const T &comp) |
Set a entity's component data to some new component data. More... | |
The Engine Instance class.
This is the most important class - the actual instance of the Joe Engine. It owns and manages all the major subsystems, such as rendering, entities and components, resource loading, and scene management. It also has many useful API functions for the user to invoke.
|
inline |
Invokes the other constructor with default settings.
|
inline |
Constructor.
Invokes the initialization function.
|
default |
Destructor (default).
|
inline |
Add a component to a particular entity.
entity | the entity to add a component to. |
void JoeEngine::JEEngineInstance::CreateDescriptor | ( | MaterialComponent & | materialComponent | ) |
Create a descriptor from the specified material component properties. Invokes a function in the renderer.
materialComponent | the material component to create a descriptor for. |
MeshComponent JoeEngine::JEEngineInstance::CreateMeshComponent | ( | const std::string & | filepath | ) |
Create a mesh component with a specific path to a mesh file. Invokes a mesh loading function in the renderer.
filepath | the mesh file source path. |
void JoeEngine::JEEngineInstance::CreateShader | ( | MaterialComponent & | materialComponent, |
const std::string & | vertFilepath, | ||
const std::string & | fragFilepath | ||
) |
Load a shader into the engine at a specific vertex/fragment filepath pair and store in the material component.
Invokes the shader loading function in the renderer.
materialComponent | the material component to create a shader for. |
vertFilepath | the vertex shader file source path. |
fragFilepath | the fragment shader file source path. |
void JoeEngine::JEEngineInstance::DestroyEntity | ( | Entity | entity | ) |
User function - destroy an entity in the scene.
entity | the entity to destroy. |
|
inline |
Get the component attached to an entity.
entity | the entity to get the component for |
|
inline |
Get a particular component manager's list of components.
|
inline |
Get the IO subsystem.
|
inline |
Get the renderer subsystem.
void JoeEngine::JEEngineInstance::InstantiateParticleSystem | ( | const JEParticleSystemSettings & | settings, |
const MaterialComponent & | materialComponent | ||
) |
Instantiate a particle system with specific settings in the scene.
settings | the user-provided particle system settings. |
materialComponent | the material properties for the particle system. |
void JoeEngine::JEEngineInstance::LoadScene | ( | uint32_t | id | ) |
Load a particular scene.
id | the scene ID to load. |
uint32_t JoeEngine::JEEngineInstance::LoadTexture | ( | const std::string & | filepath | ) |
Load a texture into the engine at a specific path. Invokes a function in the renderer.
filepath | the texture file source path. |
|
inline |
Register a component manager with the engine.
void JoeEngine::JEEngineInstance::Run | ( | ) |
Run the main loop.
|
inline |
Set a entity's component data to some new component data.
entity | the entity to set the component for. |
comp | the new component data. |
Entity JoeEngine::JEEngineInstance::SpawnEntity | ( | ) |
User function - spawn an entity into the scene.