A renderer, implementing the logic of using a graphics API. More...
Public Member Functions | |
| Renderer () noexcept | |
| virtual | ~Renderer () |
| virtual DataAllocator * | getAllocator () const =0 |
| virtual RendererSupportInfo | getRendererSupportInfo () const =0 |
| virtual nkMemory::UniquePtr< nkExport::Node > | getStats () const =0 |
| virtual RendererAbstractData | getInternalData () const |
| RENDERING_API | getRenderApi () const |
| virtual bool | initialize (const Configuration &config)=0 |
| virtual bool | initiateBuiltInShaders ()=0 |
| virtual bool | postGraphicSystemInit ()=0 |
| virtual void | prepareForRelease ()=0 |
| virtual bool | shutdown ()=0 |
| virtual void | flushRendering ()=0 |
| virtual void | preRenderRoutine ()=0 |
| virtual void | postRenderRoutine ()=0 |
A renderer, implementing the logic of using a graphics API.
There is one per supported graphics API, and it is chosen at startup based on the configuration provided and the capabilities of the machine. In theory, external code should only use this class to :
|
noexcept |
Constructor.
|
virtual |
Destructor.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
virtual |
Allows to retrieve internal data proper to each renderer type. This data can allow a client application to hook deep into the renderer, but must be done with care as the renderer won't be aware of the potential injection.
Per renderer, what can be expected :
| Key | Underlying type | Syntax | Description | |
|---|---|---|---|---|
| Dx11Renderer | ||||
| DEVICE | ID3D11Device | (ID3D11Device*)d.get("DEVICE") ; | The device interface used by the renderer. | |
| CONTEXT | ID3D11DeviceContext | (ID3D11DeviceContext*)d.get("CONTEXT") ; | The device context interface used by the renderer. | |
| Dx12Renderer | ||||
| DEVICE | ID3D12Device | (ID3D12Device*)d.get("DEVICE") ; | The device interface used by the renderer. | |
| DIRECT_COMMAND_QUEUE | ID3D12CommandQueue | (ID3D12CommandQueue*)d.get("DIRECT_COMMAND_QUEUE") ; | The direct command queue used by the renderer. | |
| RESOURCE_COMMAND_QUEUE | ID3D12CommandQueue | (ID3D12CommandQueue*)d.get("RESOURCE_COMMAND_QUEUE") ; | The resource command queue used by the renderer. | |
| GlesRenderer | ||||
| BASE_HDC | HDC | (HDC)d.get("HDC") ; | The base HDC used by the renderer. Note that this uses the base window created by the renderer, not a client application's one. | |
| CONTEXT | HGLRC | (HGLRC)d.get("CONTEXT") ; | The HGLRC context used by the renderer. | |
| RENDERING_API nkGraphics::Renderer::getRenderApi | ( | ) | const |
|
pure virtual |
Initializes the renderer given a configuration. This is taken care of by the component initialization process and should not be called by external code.
| config | The configuration to use to initialize the renderer. |
|
pure virtual |
Initializes the built in shaders. This is taken care of by the component initialization process and should not be called by external code.
|
pure virtual |
Post initialization step. This is taken care of by the component initialization process and should not be called by external code.
|
pure virtual |
Prepares the renderer for shutdown. This is taken care of by the component initialization process and should not be called by external code.
|
pure virtual |
Shuts down the renderer and frees all related memory. This is taken care of by the component initialization process and should not be called by external code.
|
pure virtual |
Flushes the rendering pipeline. This ensures that :
This can be used to ensure a resource will be available next frame, for instance, as they can be loaded in async.
|
pure virtual |
A pre render step, part of the rendering process. In theory, should never be called by external code.
|
pure virtual |
A post render step, part of the rendering process. In theory, should never be called by external code.