![]() |
PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
|
Definition at line 30 of file PureRendererHWfixedPipe.cpp.
Classes | |
struct | CurrentStats |
Renderer statistics collected until next ResetStatistics(). More... | |
class | LastFrameStats |
Last frame statistics collected until end of frame, then reset at the beginning of next frame. More... | |
Public Member Functions | |
virtual | ~PureRendererHWfixedPipeImpl () |
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) |
Initializes the renderer. | |
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 | RenderScene () |
Renders the scene. | |
const TPURE_RENDER_HINT & | getRenderHints () |
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. | |
TPureUInt | getLastFrameObjectsVisible () const |
Returns number of objects allowed to be visible in last frame. | |
TPureUInt | getLastFrameOccluders () const |
Returns number of objects that were occluders in last frame. | |
TPureUInt | getLastFrameOccludeesNonOcclusionTested () const |
Returns number of occludees that had occlusion test disabled in last frame. | |
TPureUInt | getLastFrameOccludeesOcclusionTested () const |
Returns number of occludees that had occlusion test enabled (not necessarily ongoing) in last frame. | |
TPureUInt | getLastFrameOccludeesOcclusionTestedAndOccluded () const |
Returns number of occluded occludees in last frame (only counted if occlusion test was also enabled). | |
TPureUInt | getLastFrameOccludeesOcclusionTestedAndNonOccluded () const |
Returns number of non-occluded occludees in last frame (only counted if occlusion test was also enabled). | |
TPureUInt | getLastFrameOccludeesOcclusionTestedAndNonOccludedButNonVisibleAnyway () const |
Returns number of non-occluded occludees in last frame (only counted if occlusion test was also enabled but visibility was not). | |
TPureUInt | getLastFrameTransferredVertices () const |
Returns number of transferred vertices in last frame. | |
TPureUInt | getLastFrameTransferredTriangles () const |
Returns number of transferred triangles in last frame. | |
![]() | |
CConsole & | getConsole () const |
Returns access to console preset with logger module name as this class. | |
![]() |
Static Public Attributes | |
static TPureBool | OQ_AUTO_UPDATE_OCCLUDER_STATES = true |
static TPureBool | OQ_ZPASS_FOR_OCCLUDERS = false |
static std::map< TPureUInt, std::string > | mapRenderPaths2String |
static std::map< TPureUInt, std::string > | mapOcclusionQueryMethod2String |
static std::vector< CurrentStats > | stats |
static LastFrameStats | lastFrameStats |
![]() | |
static const TPURE_RENDER_HINT | DefaultHints |
Default render hints for PureRendererHWfixedPipe. | |
Private Member Functions | |
PureRendererHWfixedPipeImpl () | |
NULLs members only. | |
PureRendererHWfixedPipeImpl (PGEcfgProfiles &cfgProfiles, PureWindow &_wnd, PureScreen &_scr, PureHwInfo &_hwinfo) | |
PureRendererHWfixedPipeImpl (const PureRendererHWfixedPipeImpl &) | |
PureRendererHWfixedPipeImpl & | operator= (const PureRendererHWfixedPipeImpl &) |
void | printOGLerrorBrief () |
Writes OpenGL error to console only if there is really an error. | |
void | printOGLerrorFull () |
Writes OpenGL error to console even the error is no error. | |
void | LogFullRenderHints (const TPURE_RENDER_HINT &hints) const |
Logs given render hints with full descriptive text. | |
void | LogLastFrameStats () const |
Logs last frame stats. | |
void | LogCollectedStats (TPureUInt i) const |
void | LogLastCollectedStats () const |
TPureBool | initializeOpenGL (HDC dc) |
Initializes OpenGL. | |
TPureBool | shutdownOpenGL () |
Shuts down OpenGL. | |
void | SetBasicThingsInOpenGL () |
Sets some basic things in OpenGL. | |
void | RenderObject (PureObject3D &object) |
Not implemented. | |
void | BeginRendering () |
Sets viewport size and clears buffers. | |
void | SwitchToPerspectiveProjection () |
Sets perspective projection. | |
void | SwitchToOrtographicProjection () |
Sets orthographic projection. | |
void | OrderObjectContainersByZdistance () |
Orders objects by Z-distance relative to camera view. | |
void | Draw3DObjects_Legacy (PureIRenderer &renderer) |
Draws 3D objects, the legacy PR00FPS way. | |
void | Draw3DObjects_Ordered_Containers (PureIRenderer &renderer) |
Draws 3D objects using separate Object3D containers. | |
void | Draw3DObjects_OcclusionQuery (PureIRenderer &renderer, TPureBool bASyncQuery) |
Draws 3D objects with occlusion query. | |
void | Draw2DObjects (PureIRenderer &renderer) |
Draws 2D objects. | |
void | FinishRendering () |
Forces pending tasks to be finished and displays the rendered picture. | |
Private Attributes | |
PGEcfgProfiles & | m_cfgProfiles |
PureWindow & | wnd |
Our window, where we draw to, singleton. | |
PureHwInfo & | hwInfo |
Hardware infos, singleton. | |
PureScreen & | screen |
Our screen, singleton. | |
PureObject3DManager * | pObject3DMgr |
ObjectManager, at least 1 instance. | |
PureCamera * | pCamera |
Camera, at least 1 instance. | |
PureUiManager * | pUImgr |
UI manager, singleton. | |
HGLRC | rc |
Rendering context, initially NULL. | |
GLfloat | mat4x4Identity [4][4] |
PFL::timeval | timeDurationStart |
Friends | |
class | PureRendererHWfixedPipe |
Additional Inherited Members | |
![]() | |
static PureRendererHWfixedPipe & | createAndGet (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. | |
|
virtual |
Calls shutdown().
Definition at line 350 of file PureRendererHWfixedPipe.cpp.
|
private |
NULLs members only.
Definition at line 854 of file PureRendererHWfixedPipe.cpp.
|
private |
Definition at line 886 of file PureRendererHWfixedPipe.cpp.
|
private |
Definition at line 922 of file PureRendererHWfixedPipe.cpp.
|
private |
Sets viewport size and clears buffers.
Definition at line 1138 of file PureRendererHWfixedPipe.cpp.
void PureRendererHWfixedPipeImpl::CheckConsistency | ( | ) | const |
Runs an internal consistency test, just for debug.
Definition at line 769 of file PureRendererHWfixedPipe.cpp.
|
private |
Draws 2D objects.
Draws 2D objects (stickedToScreen and UI).
Definition at line 1524 of file PureRendererHWfixedPipe.cpp.
|
private |
Draws 3D objects, the legacy PR00FPS way.
Definition at line 1325 of file PureRendererHWfixedPipe.cpp.
|
private |
Draws 3D objects with occlusion query.
The difference compared to Draw3DObjects_Ordered_Containers():
bASyncQuery | If true, the result of occlusion queries are not waited for in the same frame, instead they will be evaulated in a future frame whenever they are available. If false, all occlusion queries must finish in the frame, to decide if we should really render the occludee. |
Definition at line 1414 of file PureRendererHWfixedPipe.cpp.
|
private |
Draws 3D objects using separate Object3D containers.
The difference compared to Draw3DObjects_Legacy():
Definition at line 1363 of file PureRendererHWfixedPipe.cpp.
|
private |
Forces pending tasks to be finished and displays the rendered picture.
Definition at line 1560 of file PureRendererHWfixedPipe.cpp.
|
virtual |
Returns number of objects allowed to be visible in last frame.
Implements PureRendererHWfixedPipe.
Definition at line 780 of file PureRendererHWfixedPipe.cpp.
|
virtual |
Returns number of occludees that had occlusion test disabled in last frame.
Implements PureRendererHWfixedPipe.
Definition at line 796 of file PureRendererHWfixedPipe.cpp.
|
virtual |
Returns number of occludees that had occlusion test enabled (not necessarily ongoing) in last frame.
Implements PureRendererHWfixedPipe.
Definition at line 804 of file PureRendererHWfixedPipe.cpp.
|
virtual |
Returns number of non-occluded occludees in last frame (only counted if occlusion test was also enabled).
Implements PureRendererHWfixedPipe.
Definition at line 820 of file PureRendererHWfixedPipe.cpp.
|
virtual |
Returns number of non-occluded occludees in last frame (only counted if occlusion test was also enabled but visibility was not).
Implements PureRendererHWfixedPipe.
Definition at line 828 of file PureRendererHWfixedPipe.cpp.
|
virtual |
Returns number of occluded occludees in last frame (only counted if occlusion test was also enabled).
Implements PureRendererHWfixedPipe.
Definition at line 812 of file PureRendererHWfixedPipe.cpp.
|
virtual |
Returns number of objects that were occluders in last frame.
Implements PureRendererHWfixedPipe.
Definition at line 788 of file PureRendererHWfixedPipe.cpp.
|
virtual |
Returns number of transferred triangles in last frame.
Implements PureRendererHWfixedPipe.
Definition at line 839 of file PureRendererHWfixedPipe.cpp.
|
virtual |
Returns number of transferred vertices in last frame.
Implements PureRendererHWfixedPipe.
Definition at line 834 of file PureRendererHWfixedPipe.cpp.
|
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 634 of file PureRendererHWfixedPipe.cpp.
|
virtual |
Initializes the renderer.
Tries to set the given display mode. Render hints are not affected.
width | Client 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. |
height | Height 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. |
dmode | Display mode to be set. |
freq | The refresh rate to be set. If 0, the highest possible will be set at the given resolution. Ignored in windowed mode. |
cdepth | The color depth to be set. Ignored in windowed mode. |
zdepth | The 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. |
stencil | The stencil buffer depth to be set. 0 means 0, any other value means 8. |
samples | The level of antialiasing, < 2 means no AA thus no sample buffers, 2 means 2x AA, 4 means 4x AA, and so on ... |
window | If a target window is already created for rendering purpose, it can be specified here. To be used for legacy reasons only. |
Implements PureIRenderer.
Definition at line 356 of file PureRendererHWfixedPipe.cpp.
|
private |
|
virtual |
Gets the state of the renderer.
Implements PureIRenderer.
Definition at line 543 of file PureRendererHWfixedPipe.cpp.
|
private |
Definition at line 1008 of file PureRendererHWfixedPipe.cpp.
|
private |
Logs given render hints with full descriptive text.
Definition at line 968 of file PureRendererHWfixedPipe.cpp.
|
private |
Definition at line 1027 of file PureRendererHWfixedPipe.cpp.
|
private |
Logs last frame stats.
Definition at line 991 of file PureRendererHWfixedPipe.cpp.
|
private |
Definition at line 934 of file PureRendererHWfixedPipe.cpp.
|
private |
Orders objects by Z-distance relative to camera view.
No effect if PURE_RH_ORDERING_BY_DISTANCE_BIT is not set.
This approach is based on a comment on this page: https://community.khronos.org/t/sorting-objects-by-distance-for-correct-blending/49579/3 From: k_szczech - Senior Member - May 2007 "Few words about sorting: - Do not compute distance - compute dot product along camera’s Z axis - not only faster but also more accurate (z-buffer is not “spherical”). - After you have sorted by Z component you can perform additional sort. Instead of comparing Z coordinates of polygon’s center, compare two polygons by testing if one is on the clock wise or counter clock wise side of another. You can even use bubble sort this time since most polyons are in proper order anyway. - Some polygons can be merged into groups that never occlude each other. Imagine car windows - if you first draw all windows from the inside and then all windows from the outside then you get corret result. So instead of sorting all polygons you only have 2 groups which additionally are in constant relation with each other."
For more about transparent object rendering:
Definition at line 1276 of file PureRendererHWfixedPipe.cpp.
|
private |
Writes OpenGL error to console only if there is really an error.
Definition at line 943 of file PureRendererHWfixedPipe.cpp.
|
private |
Writes OpenGL error to console even the error is no error.
Definition at line 954 of file PureRendererHWfixedPipe.cpp.
|
privatevirtual |
Not implemented.
Use RenderScene() to render all objects.
Implements PureRendererHWfixedPipe.
Definition at line 560 of file PureRendererHWfixedPipe.cpp.
|
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 566 of file PureRendererHWfixedPipe.cpp.
|
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 713 of file PureRendererHWfixedPipe.cpp.
|
private |
Sets some basic things in OpenGL.
Definition at line 1101 of file PureRendererHWfixedPipe.cpp.
|
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 549 of file PureRendererHWfixedPipe.cpp.
|
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 640 of file PureRendererHWfixedPipe.cpp.
|
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.
Implements PureIRenderer.
Definition at line 510 of file PureRendererHWfixedPipe.cpp.
|
private |
|
private |
Sets orthographic projection.
Definition at line 1206 of file PureRendererHWfixedPipe.cpp.
|
private |
Sets perspective projection.
Definition at line 1174 of file PureRendererHWfixedPipe.cpp.
|
virtual |
Writes "Current Statistics" and "Last Frame Statistics" to the console window.
These are explained at Debugging.
Implements PureIRenderer.
Definition at line 741 of file PureRendererHWfixedPipe.cpp.
|
friend |
Definition at line 177 of file PureRendererHWfixedPipe.cpp.
|
private |
Hardware infos, singleton.
Definition at line 131 of file PureRendererHWfixedPipe.cpp.
|
static |
Definition at line 87 of file PureRendererHWfixedPipe.cpp.
|
private |
Definition at line 129 of file PureRendererHWfixedPipe.cpp.
|
static |
Definition at line 85 of file PureRendererHWfixedPipe.cpp.
|
static |
Definition at line 84 of file PureRendererHWfixedPipe.cpp.
|
private |
Definition at line 138 of file PureRendererHWfixedPipe.cpp.
|
static |
Definition at line 81 of file PureRendererHWfixedPipe.cpp.
|
static |
Definition at line 82 of file PureRendererHWfixedPipe.cpp.
|
private |
Camera, at least 1 instance.
Definition at line 134 of file PureRendererHWfixedPipe.cpp.
|
private |
ObjectManager, at least 1 instance.
Definition at line 133 of file PureRendererHWfixedPipe.cpp.
|
private |
UI manager, singleton.
Definition at line 135 of file PureRendererHWfixedPipe.cpp.
|
private |
Rendering context, initially NULL.
Determines whether the renderer is initialized or not.
Definition at line 137 of file PureRendererHWfixedPipe.cpp.
|
private |
Our screen, singleton.
Definition at line 132 of file PureRendererHWfixedPipe.cpp.
|
static |
Definition at line 86 of file PureRendererHWfixedPipe.cpp.
|
private |
Definition at line 139 of file PureRendererHWfixedPipe.cpp.
|
private |
Our window, where we draw to, singleton.
Definition at line 130 of file PureRendererHWfixedPipe.cpp.