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

Detailed Description

Definition at line 30 of file PureRendererSWincremental.cpp.

+ Inheritance diagram for PureRendererSWincrementalImpl:

Public Member Functions

virtual ~PureRendererSWincrementalImpl ()
 Calls shutdown().
 
TPureUInt initialize (TPureUInt width, TPureUInt height, TPURE_DISPLAY_MODES dmode, TPureUInt freq, TPureInt cdepth, TPureInt zdepth, TPureInt stencil, TPureInt samples, HWND window=NULL)
 Documentation is at public PureRendererSWincremental class definition.
 
TPureBool shutdown ()
 This stops the renderer.
 
TPureBool isInitialized () const
 Gets the state of the renderer.
 
void SetManagers (PureObject3DManager *_objmgr, PureUiManager *_uimgr, PureCamera *_cam)
 This should be called after initialization, prior to first call to RenderScene().
 
void RenderObject (PureObject3D &object)
 Not implemented.
 
void RenderScene ()
 Renders the scene.
 
const TPURE_RENDER_HINTgetRenderHints ()
 Get current render hints.
 
void SetRenderHints (const TPURE_RENDER_HINT &hints)
 Set current render hints.
 
void ResetStatistics ()
 Resets "Current Statistics".
 
void WriteStats () const
 Writes "Current Statistics" and "Last Frame Statistics" to the console window.
 
void CheckConsistency () const
 Runs an internal consistency test, just for debug.
 
- Public Member Functions inherited from PureRendererSWincremental
CConsole & getConsole () const
 Returns access to console preset with logger module name as this class.
 
- Public Member Functions inherited from PureIRenderer
- Public Member Functions inherited from PureIIncrementalRenderPipeline

Private Member Functions

 PureRendererSWincrementalImpl ()
 NULLs members only.
 
 PureRendererSWincrementalImpl (PGEcfgProfiles &cfgProfiles, PureWindow &_wnd, PureScreen &_scr, PureHwInfo &_hwinfo)
 
 PureRendererSWincrementalImpl (const PureRendererSWincrementalImpl &)
 
PureRendererSWincrementalImploperator= (const PureRendererSWincrementalImpl &)
 
void VertexProcessing (const TXYZ *pVertices, TPureUInt nVertices_h, bool bIndexed, const void *pVertexIndices, TPureUInt nVertexIndices_h, unsigned int nIndicesType, TPURE_TRANSFORMED_VERTEX *pVerticesTransf, const TXYZ &pos, const TXYZ &rot, const TXYZ &scaling, const TXYZ &campos, const TXYZ &camrot)
 Loop over the input vertices and transform them into pVerticesTransf array.
 
void PrimitiveAssembly (TPURE_TRANSFORMED_VERTEX *pVerticesTransf, TPureUInt nVertexIndices_h, const TXYZ &pos, const TXYZ &rot, const TXYZ &campos, const TXYZ &camrot, TPureInt vp_x, TPureInt vp_y, TPureUInt vp_w, TPureUInt vp_h)
 Loop over the input triangles and throw away those which are outside of the view frustum.
 
void GeometricStage (const TXYZ *pVertices, TPureUInt nVertices_h, bool bIndexed, const void *pVertexIndices, TPureUInt nVertexIndices_h, unsigned int nIndicesType, TPURE_TRANSFORMED_VERTEX *pVerticesTransf, const TXYZ &pos, const TXYZ &rot, const TXYZ &scaling, const TXYZ &campos, const TXYZ &camrot, TPureInt vp_x, TPureInt vp_y, TPureUInt vp_w, TPureUInt vp_h)
 This should be called for every renderable object.
 
void RasterStage ()
 
void SetPixel (int x, int y, TRGBAUBYTE color, TPureInt vp_x, TPureInt vp_y, TPureUInt vp_w, TPureUInt vp_h)
 
void Line (int x1, int y1, int x2, int y2, TRGBAUBYTE color, TPureInt vp_x, TPureInt vp_y, TPureUInt vp_w, TPureUInt vp_h)
 
void RenderStage (TPureUInt nVertexIndices_h, TPURE_TRANSFORMED_VERTEX *pVerticesTransf, TPureInt vp_x, TPureInt vp_y, TPureUInt vp_w, TPureUInt vp_h)
 This should be called for every renderable object.
 
void ClearColorBuffer ()
 
void BeginRendering ()
 Sets viewport size and clears buffers.
 
void SwitchToPerspectiveProjection ()
 Sets perspective projection.
 
void SwitchToOrtographicProjection ()
 Sets orthographic projection.
 
void Draw3DObjects ()
 Draws 3D objects.
 
void Draw2DObjects ()
 Draws 2D objects.
 
void SyncToScreen ()
 
void FinishRendering ()
 Forces pending tasks to be finished and displays the rendered picture.
 
void printFeatureList (const std::string &features, const char *endstring)
 Writes the given list to console.
 
void printOGLfeatures ()
 Writes OGL feature list to console.
 
void printWGLfeatures ()
 Writes WGL feature list to console.
 

Private Attributes

TPURE_RENDER_HINT renderHints
 Render hints.
 
TPureBool bInited
 
PGEcfgProfiles & m_cfgProfiles
 
PureWindowwnd
 Our window, where we draw to, singleton.
 
PureHwInfohwInfo
 Hardware infos, singleton.
 
PureScreenscreen
 Our screen, singleton.
 
PureObject3DManagerpObject3DMgr
 ObjectManager, at least 1 instance.
 
PureCamerapCamera
 Camera, at least 1 instance.
 
PureUiManagerpUImgr
 UI manager, singleton.
 
TPureBool bLighting
 
HDC hColorBufferDC
 Memory Device Context for Color Buffer, compatible with wnd's DC.
 
BITMAPINFO biColorBufferDDB
 Attributes of Color Buffer DIB.
 
HBITMAP hColorBufferDDB
 Handle to Color Buffer DIB.
 
BYTE * pColorBufferDIB
 Color buffer.
 
float * pZBuffer
 Depth buffer.
 

Friends

class PureRendererSWincremental
 

Additional Inherited Members

- Static Public Member Functions inherited from PureRendererSWincremental
static PureRendererSWincrementalcreateAndGet (PGEcfgProfiles &cfgProfiles, PureWindow &_wnd, PureScreen &_scr, PureHwInfo &_hwinfo)
 Creates and gets the singleton implementation instance.
 
static const char * getLoggerModuleName ()
 Returns the logger module name of this class.
 
- Static Public Attributes inherited from PureRendererSWincremental
static const TPURE_RENDER_HINT DefaultHints = 0
 Default render hints for PureRendererSWincremental.
 

Constructor & Destructor Documentation

◆ ~PureRendererSWincrementalImpl()

PureRendererSWincrementalImpl::~PureRendererSWincrementalImpl ( )
virtual

Calls shutdown().

Definition at line 187 of file PureRendererSWincremental.cpp.

◆ PureRendererSWincrementalImpl() [1/3]

PureRendererSWincrementalImpl::PureRendererSWincrementalImpl ( )
private

NULLs members only.

Definition at line 432 of file PureRendererSWincremental.cpp.

◆ PureRendererSWincrementalImpl() [2/3]

PureRendererSWincrementalImpl::PureRendererSWincrementalImpl ( PGEcfgProfiles & cfgProfiles,
PureWindow & _wnd,
PureScreen & _scr,
PureHwInfo & _hwinfo )
private

Definition at line 450 of file PureRendererSWincremental.cpp.

◆ PureRendererSWincrementalImpl() [3/3]

PureRendererSWincrementalImpl::PureRendererSWincrementalImpl ( const PureRendererSWincrementalImpl & other)
private

Definition at line 472 of file PureRendererSWincremental.cpp.

Member Function Documentation

◆ BeginRendering()

void PureRendererSWincrementalImpl::BeginRendering ( )
private

Sets viewport size and clears buffers.

Definition at line 874 of file PureRendererSWincremental.cpp.

◆ CheckConsistency()

void PureRendererSWincrementalImpl::CheckConsistency ( ) const

Runs an internal consistency test, just for debug.

Definition at line 415 of file PureRendererSWincremental.cpp.

◆ ClearColorBuffer()

void PureRendererSWincrementalImpl::ClearColorBuffer ( )
private

Definition at line 842 of file PureRendererSWincremental.cpp.

◆ Draw2DObjects()

void PureRendererSWincrementalImpl::Draw2DObjects ( )
private

Draws 2D objects.

Definition at line 989 of file PureRendererSWincremental.cpp.

◆ Draw3DObjects()

void PureRendererSWincrementalImpl::Draw3DObjects ( )
private

Draws 3D objects.

Definition at line 903 of file PureRendererSWincremental.cpp.

◆ FinishRendering()

void PureRendererSWincrementalImpl::FinishRendering ( )
private

Forces pending tasks to be finished and displays the rendered picture.

Definition at line 1006 of file PureRendererSWincremental.cpp.

◆ GeometricStage()

void PureRendererSWincrementalImpl::GeometricStage ( const TXYZ * pVertices,
TPureUInt nVertices_h,
bool bIndexed,
const void * pVertexIndices,
TPureUInt nVertexIndices_h,
unsigned int nIndicesType,
TPURE_TRANSFORMED_VERTEX * pVerticesTransf,
const TXYZ & pos,
const TXYZ & rot,
const TXYZ & scaling,
const TXYZ & campos,
const TXYZ & camrot,
TPureInt vp_x,
TPureInt vp_y,
TPureUInt vp_w,
TPureUInt vp_h )
privatevirtual

This should be called for every renderable object.

Renderer cannot access private parts of objects. So objects have to provide interface for their input and output data. Input data in this case is the object's base vertices / triangle list selected by LOD. Output data are the vertices / triangle list after vertex processing and primitive assembly. Input data -> VS -> VP -> PA -> Output data.

Implements PureIIncrementalRenderPipeline.

Definition at line 678 of file PureRendererSWincremental.cpp.

◆ getRenderHints()

const TPURE_RENDER_HINT & PureRendererSWincrementalImpl::getRenderHints ( )
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.

Implements PureIRenderer.

Definition at line 388 of file PureRendererSWincremental.cpp.

◆ initialize()

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

Documentation is at public PureRendererSWincremental class definition.

Implements PureRendererSWincremental.

Definition at line 196 of file PureRendererSWincremental.cpp.

◆ isInitialized()

TPureBool PureRendererSWincrementalImpl::isInitialized ( ) const
virtual

Gets the state of the renderer.

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

Implements PureIRenderer.

Definition at line 350 of file PureRendererSWincremental.cpp.

◆ Line()

void PureRendererSWincrementalImpl::Line ( int x1,
int y1,
int x2,
int y2,
TRGBAUBYTE color,
TPureInt vp_x,
TPureInt vp_y,
TPureUInt vp_w,
TPureUInt vp_h )
private

Definition at line 721 of file PureRendererSWincremental.cpp.

◆ operator=()

PureRendererSWincrementalImpl & PureRendererSWincrementalImpl::operator= ( const PureRendererSWincrementalImpl & )
private

Definition at line 489 of file PureRendererSWincremental.cpp.

◆ PrimitiveAssembly()

void PureRendererSWincrementalImpl::PrimitiveAssembly ( TPURE_TRANSFORMED_VERTEX * pVerticesTransf,
TPureUInt nVertexIndices_h,
const TXYZ & pos,
const TXYZ & rot,
const TXYZ & campos,
const TXYZ & camrot,
TPureInt vp_x,
TPureInt vp_y,
TPureUInt vp_w,
TPureUInt vp_h )
private

Loop over the input triangles and throw away those which are outside of the view frustum.

Transform the rest to screen coordinates.

Transformation is: Clip -> NDC -> Screen coordinate systems.

Definition at line 593 of file PureRendererSWincremental.cpp.

◆ printFeatureList()

void PureRendererSWincrementalImpl::printFeatureList ( const std::string & features,
const char * endstring )
private

Writes the given list to console.

◆ printOGLfeatures()

void PureRendererSWincrementalImpl::printOGLfeatures ( )
private

Writes OGL feature list to console.

◆ printWGLfeatures()

void PureRendererSWincrementalImpl::printWGLfeatures ( )
private

Writes WGL feature list to console.

◆ RasterStage()

void PureRendererSWincrementalImpl::RasterStage ( )
private

◆ RenderObject()

void PureRendererSWincrementalImpl::RenderObject ( PureObject3D & object)
virtual

Not implemented.

Use RenderScene() to render all objects.

Implements PureRendererSWincremental.

Definition at line 367 of file PureRendererSWincremental.cpp.

◆ RenderScene()

void PureRendererSWincrementalImpl::RenderScene ( )
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.

Implements PureIRenderer.

Definition at line 373 of file PureRendererSWincremental.cpp.

◆ RenderStage()

void PureRendererSWincrementalImpl::RenderStage ( TPureUInt nVertexIndices_h,
TPURE_TRANSFORMED_VERTEX * pVerticesTransf,
TPureInt vp_x,
TPureInt vp_y,
TPureUInt vp_w,
TPureUInt vp_h )
privatevirtual

This should be called for every renderable object.

Renderer cannot access private parts of objects. So objects have to provide interface for their input and output data. Input data in this case are the fragments after GeometricStage. Output data in this case is null, since we render the output to framebuffer here. Input data -> TS -> FP -> PSP -> Framebuffer.

Implements PureIIncrementalRenderPipeline.

Definition at line 783 of file PureRendererSWincremental.cpp.

◆ ResetStatistics()

void PureRendererSWincrementalImpl::ResetStatistics ( )
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.

Implements PureIRenderer.

Definition at line 400 of file PureRendererSWincremental.cpp.

◆ SetManagers()

void PureRendererSWincrementalImpl::SetManagers ( PureObject3DManager * _objmgr,
PureUiManager * _uimgr,
PureCamera * _cam )
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.

Implements PureIRenderer.

Definition at line 356 of file PureRendererSWincremental.cpp.

◆ SetPixel()

void PureRendererSWincrementalImpl::SetPixel ( int x,
int y,
TRGBAUBYTE color,
TPureInt vp_x,
TPureInt vp_y,
TPureUInt vp_w,
TPureUInt vp_h )
private

Definition at line 702 of file PureRendererSWincremental.cpp.

◆ SetRenderHints()

void PureRendererSWincrementalImpl::SetRenderHints ( const TPURE_RENDER_HINT & hints)
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.

Implements PureIRenderer.

Definition at line 394 of file PureRendererSWincremental.cpp.

◆ shutdown()

TPureBool PureRendererSWincrementalImpl::shutdown ( )
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.

Implements PureIRenderer.

Definition at line 322 of file PureRendererSWincremental.cpp.

◆ SwitchToOrtographicProjection()

void PureRendererSWincrementalImpl::SwitchToOrtographicProjection ( )
private

Sets orthographic projection.

Definition at line 893 of file PureRendererSWincremental.cpp.

◆ SwitchToPerspectiveProjection()

void PureRendererSWincrementalImpl::SwitchToPerspectiveProjection ( )
private

Sets perspective projection.

Definition at line 883 of file PureRendererSWincremental.cpp.

◆ SyncToScreen()

void PureRendererSWincrementalImpl::SyncToScreen ( )
private

Definition at line 994 of file PureRendererSWincremental.cpp.

◆ VertexProcessing()

void PureRendererSWincrementalImpl::VertexProcessing ( const TXYZ * pVertices,
TPureUInt nVertices_h,
bool bIndexed,
const void * pVertexIndices,
TPureUInt nVertexIndices_h,
unsigned int nIndicesType,
TPURE_TRANSFORMED_VERTEX * pVerticesTransf,
const TXYZ & pos,
const TXYZ & rot,
const TXYZ & scaling,
const TXYZ & campos,
const TXYZ & camrot )
private

Loop over the input vertices and transform them into pVerticesTransf array.

Number of input vertices is nVertices_h. If bIndexed is true:

  • pVertexIndices != NULL;
  • nVertexIndices_h > 0;
  • number of output vertices is nVertexIndices_h;
  • nVertices_h <= nVertexIndices_h; else
  • pVertexIndices = NULL;
  • nVertexIndices_h = 0;
  • number of output vertices is nVertices_h.

Transformation is: Model -> World -> View -> Clip coordinate systems.

Definition at line 510 of file PureRendererSWincremental.cpp.

◆ WriteStats()

void PureRendererSWincrementalImpl::WriteStats ( ) const
virtual

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

These are explained at Debugging.

Implements PureIRenderer.

Definition at line 405 of file PureRendererSWincremental.cpp.

Friends And Related Symbol Documentation

◆ PureRendererSWincremental

friend class PureRendererSWincremental
friend

Definition at line 176 of file PureRendererSWincremental.cpp.

Member Data Documentation

◆ biColorBufferDDB

BITMAPINFO PureRendererSWincrementalImpl::biColorBufferDDB
private

Attributes of Color Buffer DIB.

Definition at line 78 of file PureRendererSWincremental.cpp.

◆ bInited

TPureBool PureRendererSWincrementalImpl::bInited
private

Definition at line 66 of file PureRendererSWincremental.cpp.

◆ bLighting

TPureBool PureRendererSWincrementalImpl::bLighting
private

Definition at line 75 of file PureRendererSWincremental.cpp.

◆ hColorBufferDC

HDC PureRendererSWincrementalImpl::hColorBufferDC
private

Memory Device Context for Color Buffer, compatible with wnd's DC.

Definition at line 77 of file PureRendererSWincremental.cpp.

◆ hColorBufferDDB

HBITMAP PureRendererSWincrementalImpl::hColorBufferDDB
private

Handle to Color Buffer DIB.

Definition at line 79 of file PureRendererSWincremental.cpp.

◆ hwInfo

PureHwInfo& PureRendererSWincrementalImpl::hwInfo
private

Hardware infos, singleton.

Definition at line 69 of file PureRendererSWincremental.cpp.

◆ m_cfgProfiles

PGEcfgProfiles& PureRendererSWincrementalImpl::m_cfgProfiles
private

Definition at line 67 of file PureRendererSWincremental.cpp.

◆ pCamera

PureCamera* PureRendererSWincrementalImpl::pCamera
private

Camera, at least 1 instance.

Definition at line 72 of file PureRendererSWincremental.cpp.

◆ pColorBufferDIB

BYTE* PureRendererSWincrementalImpl::pColorBufferDIB
private

Color buffer.

Definition at line 80 of file PureRendererSWincremental.cpp.

◆ pObject3DMgr

PureObject3DManager* PureRendererSWincrementalImpl::pObject3DMgr
private

ObjectManager, at least 1 instance.

Definition at line 71 of file PureRendererSWincremental.cpp.

◆ pUImgr

PureUiManager* PureRendererSWincrementalImpl::pUImgr
private

UI manager, singleton.

Definition at line 73 of file PureRendererSWincremental.cpp.

◆ pZBuffer

float* PureRendererSWincrementalImpl::pZBuffer
private

Depth buffer.

Definition at line 81 of file PureRendererSWincremental.cpp.

◆ renderHints

TPURE_RENDER_HINT PureRendererSWincrementalImpl::renderHints
private

Render hints.

Definition at line 65 of file PureRendererSWincremental.cpp.

◆ screen

PureScreen& PureRendererSWincrementalImpl::screen
private

Our screen, singleton.

Definition at line 70 of file PureRendererSWincremental.cpp.

◆ wnd

PureWindow& PureRendererSWincrementalImpl::wnd
private

Our window, where we draw to, singleton.

Definition at line 68 of file PureRendererSWincremental.cpp.


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