The Joe Engine
Joe's engine programming playground
JoeEngine::JEEngineInstance Class Reference

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...
 
JEVulkanRendererGetRenderSubsystem ()
 Get the renderer subsystem. More...
 
JEIOHandlerGetIOSubsystem ()
 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ JEEngineInstance() [1/2]

JoeEngine::JEEngineInstance::JEEngineInstance ( )
inline

Invokes the other constructor with default settings.

◆ JEEngineInstance() [2/2]

JoeEngine::JEEngineInstance::JEEngineInstance ( RendererSettings  rendererSettings)
inline

Constructor.

Invokes the initialization function.

◆ ~JEEngineInstance()

JoeEngine::JEEngineInstance::~JEEngineInstance ( )
default

Destructor (default).

Member Function Documentation

◆ AddComponent()

template<typename T >
void JoeEngine::JEEngineInstance::AddComponent ( const Entity entity)
inline

Add a component to a particular entity.

Parameters
entitythe entity to add a component to.

◆ CreateDescriptor()

void JoeEngine::JEEngineInstance::CreateDescriptor ( MaterialComponent materialComponent)

Create a descriptor from the specified material component properties. Invokes a function in the renderer.

Parameters
materialComponentthe material component to create a descriptor for.

◆ CreateMeshComponent()

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.

Parameters
filepaththe mesh file source path.
Returns
the newly created Mesh Component.

◆ CreateShader()

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.

Parameters
materialComponentthe material component to create a shader for.
vertFilepaththe vertex shader file source path.
fragFilepaththe fragment shader file source path.

◆ DestroyEntity()

void JoeEngine::JEEngineInstance::DestroyEntity ( Entity  entity)

User function - destroy an entity in the scene.

Parameters
entitythe entity to destroy.

◆ GetComponent()

template<typename T , typename U >
T* JoeEngine::JEEngineInstance::GetComponent ( const Entity entity) const
inline

Get the component attached to an entity.

Parameters
entitythe entity to get the component for
Returns
a pointer to the retrieved component.

◆ GetComponentList()

template<typename T , typename U >
const PackedArray<T>& JoeEngine::JEEngineInstance::GetComponentList ( ) const
inline

Get a particular component manager's list of components.

◆ GetIOSubsystem()

JEIOHandler& JoeEngine::JEEngineInstance::GetIOSubsystem ( )
inline

Get the IO subsystem.

◆ GetRenderSubsystem()

JEVulkanRenderer& JoeEngine::JEEngineInstance::GetRenderSubsystem ( )
inline

Get the renderer subsystem.

◆ InstantiateParticleSystem()

void JoeEngine::JEEngineInstance::InstantiateParticleSystem ( const JEParticleSystemSettings settings,
const MaterialComponent materialComponent 
)

Instantiate a particle system with specific settings in the scene.

Parameters
settingsthe user-provided particle system settings.
materialComponentthe material properties for the particle system.

◆ LoadScene()

void JoeEngine::JEEngineInstance::LoadScene ( uint32_t  id)

Load a particular scene.

Parameters
idthe scene ID to load.

◆ LoadTexture()

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.

Parameters
filepaththe texture file source path.
Returns
the newly created texture's ID.

◆ RegisterComponentManager()

template<typename T , typename U >
void JoeEngine::JEEngineInstance::RegisterComponentManager ( )
inline

Register a component manager with the engine.

◆ Run()

void JoeEngine::JEEngineInstance::Run ( )

Run the main loop.

◆ SetComponent()

template<typename U , typename T >
void JoeEngine::JEEngineInstance::SetComponent ( const Entity entity,
const T &  comp 
)
inline

Set a entity's component data to some new component data.

Parameters
entitythe entity to set the component for.
compthe new component data.

◆ SpawnEntity()

Entity JoeEngine::JEEngineInstance::SpawnEntity ( )

User function - spawn an entity into the scene.


The documentation for this class was generated from the following files: