HatchitGraphics
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Hatchit::Graphics::Renderer Class Reference
Inheritance diagram for Hatchit::Graphics::Renderer:
Hatchit::Graphics::DX::D3D12Renderer Hatchit::Graphics::Vulkan::VKRenderer

Public Member Functions

bool Initialize (const RendererParams &params)
 Initialize the renderer. More...
 
void ResizeBuffers (uint32_t width, uint32_t height)
 Resizes the the screen. More...
 
void Render ()
 Render all render passes.
 
void Present ()
 Present a frame to the screen via a backbuffer.
 
void RegisterRenderRequest (RenderPassHandle pass, MaterialHandle material, MeshHandle mesh, ShaderVariableChunk *instanceVariables)
 Register a render request with the renderer. More...
 
void RegisterCamera (Camera camera)
 Register a camera with this renderer so it can be given things to render. More...
 

Static Public Member Functions

static IDevice *const GetDevice ()
 
static SwapChain *const GetSwapChain ()
 
static RendererType GetType ()
 

Protected Member Functions

void initThreads ()
 

Protected Attributes

std::vector< std::vector< RenderPassHandle > > m_renderPassLayers = std::vector<std::vector<RenderPassHandle>>(64)
 
std::vector< std::vector< Graphics::Camera > > m_renderPassCameras = std::vector<std::vector<Graphics::Camera>>(64)
 
std::vector< RenderThread * > m_threads
 
std::mutex m_mutex
 
std::unique_lock< std::mutex > m_lock
 
std::condition_variable m_cv
 
bool m_locked
 
bool m_processed
 
Core::ThreadsafeQueue< RenderPassHandlem_threadQueue
 
RendererParams m_params
 
TextureHandle test
 

Static Protected Attributes

static IDevice_Device = nullptr
 
static GPUQueue_Queue = nullptr
 
static RendererType _Type = UNKNOWN
 
static SwapChain_SwapChain = nullptr
 

Member Function Documentation

bool Hatchit::Graphics::Renderer::Initialize ( const RendererParams params)

Initialize the renderer.

Parameters
paramsThe paramaters to intialize this renderer with
void Hatchit::Graphics::Renderer::RegisterCamera ( Camera  camera)

Register a camera with this renderer so it can be given things to render.

The camera will be sorted into a collection based on which layers it wants to render. It will then be matched and given to render passes on the same layers.

Parameters
cameraThe Camera you'd like to register with this Renderer
void Hatchit::Graphics::Renderer::RegisterRenderRequest ( RenderPassHandle  pass,
MaterialHandle  material,
MeshHandle  mesh,
ShaderVariableChunk instanceVariables 
)

Register a render request with the renderer.

Tell a RenderPass that it should render a Mesh with a Material and a ShaderVariableChunk of instance data. Then make sure that the pass is stored in a collection based on its layer. This way the cameras will be able to be matched with the passes on the same layers.

Parameters
passThe RenderPass you want to register a request with
materialA handle to the Material that you want to render with
meshA handle to the Mesh you want to render
instanceVaraiblesA pointer to a ShaderVariableChunk of instance data necessary for rendering
void Hatchit::Graphics::Renderer::ResizeBuffers ( uint32_t  width,
uint32_t  height 
)

Resizes the the screen.

Parameters
widthThe new width of the screen
heightThe new height of the screen

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