PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
Loading...
Searching...
No Matches
PureIRenderer Class Referenceabstract

Renderer interface. More...

Detailed Description

Renderer interface.

Renderer classes implementing this interface must fully conform to the method specifications written in the comments.

Basically a renderer class implementing this interface defines a rendering path.

Definition at line 55 of file PureIRenderer.h.

#include <PureIRenderer.h>

+ Inheritance diagram for PureIRenderer:

Public Member Functions

virtual TPureUInt initialize (TPureUInt width, TPureUInt height, TPURE_DISPLAY_MODES dmode, TPureUInt freq, TPureInt cdepth, TPureInt zdepth, TPureInt stencil, TPureInt samples, HWND window=NULL)=0
 Initializes the renderer.
 
virtual TPureBool shutdown ()=0
 This stops the renderer.
 
virtual TPureBool isInitialized () const =0
 Gets the state of the renderer.
 
virtual void SetManagers (PureObject3DManager *_objmgr, PureUiManager *_uimgr, PureCamera *_cam)=0
 This should be called after initialization, prior to first call to RenderScene().
 
virtual void RenderObject (PureObject3D &object)=0
 Renders the given object.
 
virtual void RenderScene ()=0
 Renders the scene.
 
virtual const TPURE_RENDER_HINTgetRenderHints ()=0
 Get current render hints.
 
virtual void SetRenderHints (const TPURE_RENDER_HINT &hints)=0
 Set current render hints.
 
virtual void ResetStatistics ()=0
 Resets "Current Statistics".
 
virtual void WriteStats () const =0
 Writes "Current Statistics" and "Last Frame Statistics" to the console window.
 

Member Function Documentation

◆ getRenderHints()

virtual const TPURE_RENDER_HINT & PureIRenderer::getRenderHints ( )
pure virtual

Get current render hints.

Render hints are basically debug settings for the renderer used in rare circumstances. The available render hints are documented at each renderer implementation.

Implemented in PureRendererHWfixedPipeImpl, and PureRendererSWincrementalImpl.

◆ initialize()

virtual TPureUInt PureIRenderer::initialize ( TPureUInt width,
TPureUInt height,
TPURE_DISPLAY_MODES dmode,
TPureUInt freq,
TPureInt cdepth,
TPureInt zdepth,
TPureInt stencil,
TPureInt samples,
HWND window = NULL )
pure virtual

Initializes the renderer.

Tries to set the given display mode. Render hints are not affected.

Parameters
widthClient width of the window being created. If 0, the target width will be the current horizontal screen resolution. If the current horizontal screen resolution can't be queried, the target width will be 800.
heightHeight of the window being created. If 0, the target height will be the current vertical screen resolution. If the current vertical screen resolution can't be queried, the target height will be 600.
dmodeDisplay mode to be set.
freqThe refresh rate to be set. If 0, the highest possible will be set at the given resolution. Ignored in windowed mode.
cdepthThe color depth to be set. Ignored in windowed mode.
zdepthThe Z-buffer-depth to be set. Can be 32, 24 or 16. If 32 doesn't work, it tries 24, finally 16, before stopping with error.
stencilThe stencil buffer depth to be set. 0 means 0, any other value means 8.
samplesThe level of antialiasing, < 2 means no AA thus no sample buffers, 2 means 2x AA, 4 means 4x AA, and so on ...
windowIf a target window is already created for rendering purpose, it can be specified here. To be used for legacy reasons only.
Returns
The result of the initialization. 0 on success, positive value otherwise.

Implemented in PureRendererHWfixedPipeImpl, PureRendererSWincremental, and PureRendererSWincrementalImpl.

◆ isInitialized()

virtual TPureBool PureIRenderer::isInitialized ( ) const
pure virtual

Gets the state of the renderer.

Returns
True if the renderer is successfully initialized, false before initialization or after shutdown.

Implemented in PureRendererHWfixedPipeImpl, and PureRendererSWincrementalImpl.

◆ RenderObject()

virtual void PureIRenderer::RenderObject ( PureObject3D & object)
pure virtual

Renders the given object.

No effect if the engine is not initialized.

Implemented in PureRendererHWfixedPipe, PureRendererHWfixedPipeImpl, PureRendererSWincremental, and PureRendererSWincrementalImpl.

◆ RenderScene()

virtual void PureIRenderer::RenderScene ( )
pure virtual

Renders the scene.

No effect if the engine is not initialized. Note that the first call to this function might not result in actually producing picture of the scene, because the implementing renderer might use "feedback mode" which means that the geometry is transformed into feedback buffer for debugging purposes, and rasterization is not happening. This is true only for newly created objects though, which are rendered for the first time.

Implemented in PureRendererHWfixedPipeImpl, and PureRendererSWincrementalImpl.

◆ ResetStatistics()

virtual void PureIRenderer::ResetStatistics ( )
pure virtual

Resets "Current Statistics".

The renderer might collect statistical data during its lifetime or for a shorter period, that might be shown in debug log by WriteStats(). In any circumstances you want to reset this data i.e. restart measurements, this function does the job. If logging is enabled, it also logs statistics.

Implemented in PureRendererHWfixedPipeImpl, and PureRendererSWincrementalImpl.

◆ SetManagers()

virtual void PureIRenderer::SetManagers ( PureObject3DManager * _objmgr,
PureUiManager * _uimgr,
PureCamera * _cam )
pure virtual

This should be called after initialization, prior to first call to RenderScene().

This is because these managers may depend on the initialization status of the renderer.

Implemented in PureRendererHWfixedPipeImpl, and PureRendererSWincrementalImpl.

◆ SetRenderHints()

virtual void PureIRenderer::SetRenderHints ( const TPURE_RENDER_HINT & hints)
pure virtual

Set current render hints.

Render hints are basically debug settings for the renderer used in rare circumstances. The available render hints are documented at each renderer implementation.

Implemented in PureRendererHWfixedPipeImpl, and PureRendererSWincrementalImpl.

◆ shutdown()

virtual TPureBool PureIRenderer::shutdown ( )
pure virtual

This stops the renderer.

Deletes everything created by the renderer. No effect before initialization. After shutdown, initialize() can be called again. Render hints are not affected.

Returns
True on successful shutdown, false otherwise.

Implemented in PureRendererHWfixedPipeImpl, and PureRendererSWincrementalImpl.

◆ WriteStats()

virtual void PureIRenderer::WriteStats ( ) const
pure virtual

Writes "Current Statistics" and "Last Frame Statistics" to the console window.

These are explained at Debugging.

Implemented in PureRendererHWfixedPipeImpl, and PureRendererSWincrementalImpl.


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