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

Detailed Description

Definition at line 21 of file PureVertexTransferModeImpl.h.

#include <PureVertexTransferModeImpl.h>

Public Member Functions

virtual ~PureVertexTransferImpl ()
 
TPURE_VERTEX_MODIFYING_HABIT getVertexModifyingHabit () const
 
TPURE_VERTEX_REFERENCING_MODE getVertexReferencingMode () const
 
TPURE_VERTEX_TRANSFER_MODE getVertexTransferMode () const
 
TPureBool setVertexTransferMode (TPURE_VERTEX_TRANSFER_MODE vtrans)
 
TPureUInt getLastTransferredVertexCount () const
 
TPureUInt getLastTransferredTriangleCount () const
 
TPureUInt getUsedSystemMemory () const
 

Static Public Member Functions

static TPURE_PRIMITIVE_FORMAT getPureprimitiveFromGLprimitive (GLenum glprim)
 
static GLenum getGLprimitiveFromPureprimitive (TPURE_PRIMITIVE_FORMAT pf)
 

Protected Member Functions

 PureVertexTransferImpl (PureVertexTransfer *pOwner, PureMaterialManager &matMgr, const TPURE_VERTEX_MODIFYING_HABIT &vmod=PURE_VMOD_STATIC, const TPURE_VERTEX_REFERENCING_MODE &vref=PURE_VREF_DIRECT, TPureBool bForceUseClientMemory=false)
 
 PureVertexTransferImpl (const PureVertexTransferImpl &)
 
PureVertexTransferImploperator= (const PureVertexTransferImpl &)
 
TPureUInt transferVertices ()
 
void ResetLastTransferredCounts ()
 

Private Member Functions

TPureBool isSwitchFromIndexedAllowed () const
 Tells whether it is allowed to switch from indexed to non-indexed vertex transfer mode.
 
void ProcessGeometry (TPureBool indexed) const
 Goes thru vertices and feeds them to OpenGL.
 
TPureBool compileIntoDisplayList (TPureBool indexed)
 Compiles OpenGL drawing commands into display list.
 
TPureBool compileIntoVertexBufferObjects (TPureBool indexed, TPureBool dynamic)
 Compiles geometry into VBOs.
 
void FreeGLresources ()
 Frees up allocated resources from OpenGL.
 
void SetArrayPointers (TPureBool redirectToServer=false) const
 Sets vertex data pointers prior to drawing.
 
void ResetArrayPointers (TPureBool redirectToServer=false) const
 Resets pointers after drawing.
 

Private Attributes

PureMaterialManagermaterialMgr
 Used to know number of texture layers/units.
 
PureVertexTransfer_pOwner
 
TPURE_VERTEX_TRANSFER_MODE vertexTransferMode
 Vertices storage.
 
TPureBool bParentInitiatedOperation
 Parent VertexTransfer sets this to true at the beginning of setVertexTransferMode(), submeshes ignore if this is not true in parent.
 
GLuint nDispList
 OpenGL display list index.
 
GLuint nVerticesVBO
 OpenGL VBO index of vertices.
 
GLuint nColorsVBO
 OpenGL VBO index of colors.
 
std::vector< GLuint > nTexcoordsVBO
 OpenGL VBO indices of texture mapping coordinates per layer.
 
GLuint nNormalsVBO
 OpenGL VBO index of normals.
 
GLuint nIndicesVBO
 OpenGL VBO index of indices.
 
TPureUInt nLastTransferredVertices
 Number of vertices transferred by last transferVertices().
 
TPureUInt nLastTransferredTriangles
 Number of vertices transferred by last transferVertices().
 

Friends

class PureVertexTransfer
 
class PureObject3D
 

Constructor & Destructor Documentation

◆ ~PureVertexTransferImpl()

PureVertexTransfer::PureVertexTransferImpl::~PureVertexTransferImpl ( )
virtual

Definition at line 167 of file PureVertexTransferMode.cpp.

◆ PureVertexTransferImpl() [1/2]

PureVertexTransfer::PureVertexTransferImpl::PureVertexTransferImpl ( PureVertexTransfer * pOwner,
PureMaterialManager & matMgr,
const TPURE_VERTEX_MODIFYING_HABIT & vmod = PURE_VMOD_STATIC,
const TPURE_VERTEX_REFERENCING_MODE & vref = PURE_VREF_DIRECT,
TPureBool bForceUseClientMemory = false )
protected
Parameters
pOwnerThe public Mesh3D class instance owning this pimpl mesh.
matMgrA MaterialManager instance to be used for knowing texture unit / layers count.
vmodWhat vertex modifying habit to be set for the new Mesh3D instance.
vrefWhat vertex referencing mode to be set for the new Mesh3D instance.
bForceUseClientMemoryForce-select a vertex transfer mode storing geometry in client memory instead of server memory. Please note that this is considered only if dynamic modifying habit is specified. Specifying static modifying habit will always select a mode which places geometry data into server memory.

Definition at line 333 of file PureVertexTransferMode.cpp.

◆ PureVertexTransferImpl() [2/2]

PureVertexTransfer::PureVertexTransferImpl::PureVertexTransferImpl ( const PureVertexTransferImpl & )
protected

Definition at line 357 of file PureVertexTransferMode.cpp.

Member Function Documentation

◆ compileIntoDisplayList()

TPureBool PureVertexTransfer::PureVertexTransferImpl::compileIntoDisplayList ( TPureBool indexed)
private

Compiles OpenGL drawing commands into display list.

Parameters
indexedIf true, will issue ProcessGeometry() to go thru geometry data by using indices for order.
Returns
True on success, false otherwise.

Definition at line 581 of file PureVertexTransferMode.cpp.

◆ compileIntoVertexBufferObjects()

TPureBool PureVertexTransfer::PureVertexTransferImpl::compileIntoVertexBufferObjects ( TPureBool indexed,
TPureBool dynamic )
private

Compiles geometry into VBOs.

Parameters
indexedIf true, will go thru geometry data by using indices for order. This will generate an element array buffer. Ignored if vertex indices array is NULL.
dynamicIf true, the usage hint when building vertex buffer objects will be dynamic, otherwise static.
Returns
True on success, false otherwise.

Definition at line 626 of file PureVertexTransferMode.cpp.

◆ FreeGLresources()

void PureVertexTransfer::PureVertexTransferImpl::FreeGLresources ( )
private

Frees up allocated resources from OpenGL.

Should be called before setting a new Vertex Transfer mode and when deleting the mesh.

Definition at line 733 of file PureVertexTransferMode.cpp.

◆ getGLprimitiveFromPureprimitive()

GLenum PureVertexTransfer::PureVertexTransferImpl::getGLprimitiveFromPureprimitive ( TPURE_PRIMITIVE_FORMAT pf)
static

Definition at line 151 of file PureVertexTransferMode.cpp.

◆ getLastTransferredTriangleCount()

TPureUInt PureVertexTransfer::PureVertexTransferImpl::getLastTransferredTriangleCount ( ) const

Definition at line 308 of file PureVertexTransferMode.cpp.

◆ getLastTransferredVertexCount()

TPureUInt PureVertexTransfer::PureVertexTransferImpl::getLastTransferredVertexCount ( ) const

Definition at line 302 of file PureVertexTransferMode.cpp.

◆ getPureprimitiveFromGLprimitive()

TPURE_PRIMITIVE_FORMAT PureVertexTransfer::PureVertexTransferImpl::getPureprimitiveFromGLprimitive ( GLenum glprim)
static

Definition at line 135 of file PureVertexTransferMode.cpp.

◆ getUsedSystemMemory()

TPureUInt PureVertexTransfer::PureVertexTransferImpl::getUsedSystemMemory ( ) const

Definition at line 314 of file PureVertexTransferMode.cpp.

◆ getVertexModifyingHabit()

TPURE_VERTEX_MODIFYING_HABIT PureVertexTransfer::PureVertexTransferImpl::getVertexModifyingHabit ( ) const

Definition at line 178 of file PureVertexTransferMode.cpp.

◆ getVertexReferencingMode()

TPURE_VERTEX_REFERENCING_MODE PureVertexTransfer::PureVertexTransferImpl::getVertexReferencingMode ( ) const

Definition at line 184 of file PureVertexTransferMode.cpp.

◆ getVertexTransferMode()

TPURE_VERTEX_TRANSFER_MODE PureVertexTransfer::PureVertexTransferImpl::getVertexTransferMode ( ) const

Definition at line 190 of file PureVertexTransferMode.cpp.

◆ isSwitchFromIndexedAllowed()

TPureBool PureVertexTransfer::PureVertexTransferImpl::isSwitchFromIndexedAllowed ( ) const
private

Tells whether it is allowed to switch from indexed to non-indexed vertex transfer mode.

Tells whether it is allowed to switch from indexed to non-indexed vertex referencing mode.

It is allowed when geometry data is stored redundantly so direct referencing is available. Geometry data is stored redundantly when multiple vertices are defined with the same position for different faces. In this situation, the number of vertex indices is equal to the number of defined vertices so the number of defined vertices is the adequate number for rendering the whole geometry even without using indices. So switching to non-indexed is disallowed only when the number of defined vertices is less than the number of indices.

Returns
True if swithing from indexed to non-indexed vertex referencing mode is allowed, false otherwise.

Definition at line 488 of file PureVertexTransferMode.cpp.

◆ operator=()

PureVertexTransfer::PureVertexTransferImpl & PureVertexTransfer::PureVertexTransferImpl::operator= ( const PureVertexTransferImpl & )
protected

Definition at line 363 of file PureVertexTransferMode.cpp.

◆ ProcessGeometry()

void PureVertexTransfer::PureVertexTransferImpl::ProcessGeometry ( TPureBool indexed) const
private

Goes thru vertices and feeds them to OpenGL.

Used by any vertex transfer mode not utilizing vertex arrays, such as:

  • immediate mode;
  • display lists. Handles both direct and indexed vertex reference modes. Since level-1 meshes don't have geometry, this function is invoked for level-2 meshes.
Parameters
indexedIf true, will go thru vertices by using pVertexIndices for ordering, otherwise won't use it.

Definition at line 517 of file PureVertexTransferMode.cpp.

◆ ResetArrayPointers()

void PureVertexTransfer::PureVertexTransferImpl::ResetArrayPointers ( TPureBool redirectToServer = false) const
private

Resets pointers after drawing.

Resets vertex data pointers after drawing.

Can be used for both vertex buffer objects and legacy vertex arrays.

Parameters
redirectToServerSpecify true if geometry data is located in server memory.

Definition at line 861 of file PureVertexTransferMode.cpp.

◆ ResetLastTransferredCounts()

void PureVertexTransfer::PureVertexTransferImpl::ResetLastTransferredCounts ( )
protected

Definition at line 466 of file PureVertexTransferMode.cpp.

◆ SetArrayPointers()

void PureVertexTransfer::PureVertexTransferImpl::SetArrayPointers ( TPureBool redirectToServer = false) const
private

Sets vertex data pointers prior to drawing.

Can be used for both vertex buffer objects and legacy vertex arrays.

Parameters
redirectToServerSpecify true if geometry data is located in server memory.

Definition at line 785 of file PureVertexTransferMode.cpp.

◆ setVertexTransferMode()

TPureBool PureVertexTransfer::PureVertexTransferImpl::setVertexTransferMode ( TPURE_VERTEX_TRANSFER_MODE vtrans)

Definition at line 196 of file PureVertexTransferMode.cpp.

◆ transferVertices()

TPureUInt PureVertexTransfer::PureVertexTransferImpl::transferVertices ( )
protected

Definition at line 369 of file PureVertexTransferMode.cpp.

Friends And Related Symbol Documentation

◆ PureObject3D

friend class PureObject3D
friend

Definition at line 92 of file PureVertexTransferModeImpl.h.

◆ PureVertexTransfer

friend class PureVertexTransfer
friend

Definition at line 91 of file PureVertexTransferModeImpl.h.

Member Data Documentation

◆ _pOwner

PureVertexTransfer* PureVertexTransfer::PureVertexTransferImpl::_pOwner
private

Definition at line 65 of file PureVertexTransferModeImpl.h.

◆ bParentInitiatedOperation

TPureBool PureVertexTransfer::PureVertexTransferImpl::bParentInitiatedOperation
private

Parent VertexTransfer sets this to true at the beginning of setVertexTransferMode(), submeshes ignore if this is not true in parent.

Definition at line 68 of file PureVertexTransferModeImpl.h.

◆ materialMgr

PureMaterialManager& PureVertexTransfer::PureVertexTransferImpl::materialMgr
private

Used to know number of texture layers/units.

Definition at line 64 of file PureVertexTransferModeImpl.h.

◆ nColorsVBO

GLuint PureVertexTransfer::PureVertexTransferImpl::nColorsVBO
private

OpenGL VBO index of colors.

Definition at line 72 of file PureVertexTransferModeImpl.h.

◆ nDispList

GLuint PureVertexTransfer::PureVertexTransferImpl::nDispList
private

OpenGL display list index.

Definition at line 70 of file PureVertexTransferModeImpl.h.

◆ nIndicesVBO

GLuint PureVertexTransfer::PureVertexTransferImpl::nIndicesVBO
private

OpenGL VBO index of indices.

Definition at line 75 of file PureVertexTransferModeImpl.h.

◆ nLastTransferredTriangles

TPureUInt PureVertexTransfer::PureVertexTransferImpl::nLastTransferredTriangles
private

Number of vertices transferred by last transferVertices().

Definition at line 78 of file PureVertexTransferModeImpl.h.

◆ nLastTransferredVertices

TPureUInt PureVertexTransfer::PureVertexTransferImpl::nLastTransferredVertices
private

Number of vertices transferred by last transferVertices().

Definition at line 77 of file PureVertexTransferModeImpl.h.

◆ nNormalsVBO

GLuint PureVertexTransfer::PureVertexTransferImpl::nNormalsVBO
private

OpenGL VBO index of normals.

Definition at line 74 of file PureVertexTransferModeImpl.h.

◆ nTexcoordsVBO

std::vector<GLuint> PureVertexTransfer::PureVertexTransferImpl::nTexcoordsVBO
private

OpenGL VBO indices of texture mapping coordinates per layer.

Definition at line 73 of file PureVertexTransferModeImpl.h.

◆ nVerticesVBO

GLuint PureVertexTransfer::PureVertexTransferImpl::nVerticesVBO
private

OpenGL VBO index of vertices.

Definition at line 71 of file PureVertexTransferModeImpl.h.

◆ vertexTransferMode

TPURE_VERTEX_TRANSFER_MODE PureVertexTransfer::PureVertexTransferImpl::vertexTransferMode
private

Vertices storage.

Definition at line 66 of file PureVertexTransferModeImpl.h.


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