PS2GL
OpenGL*-like API for the PS2
Loading...
Searching...
No Matches
CIndexedRenderer Class Reference
+ Inheritance diagram for CIndexedRenderer:
+ Collaboration diagram for CIndexedRenderer:

Public Member Functions

 CIndexedRenderer (void *packet, int packetSize, CRendererProps caps, CRendererProps reqs, int inQuadsPerVert, int outQuadsPerVert, const char *name)
 
virtual void InitContext (GLenum primType, tU32 rcChanges, bool userRcChanged)
 
virtual void DrawIndexedArrays (CGeometryBlock &block)
 Draw arrays of vertices that are accessed by index (i.e., glDrawElements)
 
virtual int GetPacketQwordSize (const CGeometryBlock &geometry)
 
virtual CRendererProps GetRenderContextDeps ()
 
virtual bool GetCachePackets (const CGeometryBlock &geometry)
 
- Public Member Functions inherited from CBaseRenderer
virtual void Load ()
 Load the renderer into vu0/vu1 memory.
 
virtual const char * GetName ()
 Return a pointer to the text name of this renderer.
 
- Public Member Functions inherited from CRenderer
virtual tU64 GetCapabilities () const
 
virtual tU64 GetRequirements () const
 
virtual void DrawLinearArrays (CGeometryBlock &block)
 Draw arrays of vertices that are accessed linearly (i.e., glDrawArrays)
 

Protected Attributes

cpu_vec_4 ConstantVertColor
 
- Protected Attributes inherited from CBaseRenderer
bool XferVertices
 
bool XferColors
 
bool XferNormals
 
bool XferTexCoords
 
bool VifDoubleBuffered
 
float CurTexCoord [2]
 
cpu_vec_xyz CurNormal
 
CDmaPacket * TexCoordBuf
 
CDmaPacket * NormalBuf
 
int WordsPerVertex
 
int WordsPerNormal
 
int WordsPerTexCoord
 
int WordsPerColor
 
unsigned int VertexUnpackMode
 
unsigned int NormalUnpackMode
 
unsigned int TexCoordUnpackMode
 
unsigned int ColorUnpackMode
 
Vifs::tMask VertexUnpackMask
 
Vifs::tMask NormalUnpackMask
 
Vifs::tMask TexCoordUnpackMask
 
Vifs::tMask ColorUnpackMask
 
int InputQuadsPerVert
 
int OutputQuadsPerVert
 
int InputGeomOffset
 
void * MicrocodePacket
 
int MicrocodePacketSize
 
const char * Name
 
- Protected Attributes inherited from CRenderer
tU64 Capabilities
 
tU64 Requirements
 

Additional Inherited Members

- Protected Member Functions inherited from CBaseRenderer
 CBaseRenderer (void *packet, int packetSize, int inQuadsPerVert, int outQuadsPerVert, int inGeomOffset, const char *name)
 
 CBaseRenderer (void *packet, int packetSize, CRendererProps caps, CRendererProps reqs, int inQuadsPerVert, int outQuadsPerVert, int inGeomOffset, const char *name)
 
void SetVifDoubleBuffered (bool db)
 
void GetUnpackAttribs (int numWords, unsigned int &mode, Vifs::tMask &mask)
 
void InitXferBlock (CVifSCDmaPacket &packet, int wordsPerVertex, int wordsPerNormal, int wordsPerTex, int wordsPerColor)
 
void XferBlock (CVifSCDmaPacket &packet, const void *vertices, const void *normals, const void *texCoords, const void *colors, int vu1Offset, int firstElement, int numToAdd)
 
void XferVectors (CVifSCDmaPacket &packet, unsigned int *dataStart, int startOffset, int numVectors, int wordsPerVec, Vifs::tMask unpackMask, tU32 unpackMode, int vu1MemOffset)
 
void AddVu1RendererContext (CVifSCDmaPacket &packet, GLenum primType, int vu1Offset)
 
tGifTag BuildGiftag (GLenum primType)
 
void CacheRendererState ()
 
float GetMaxColorValue (bool texEnabled)
 
- Protected Member Functions inherited from CRenderer
 CRenderer (tU64 caps, tU64 reqs)
 
void SetCapabilities (tU64 caps)
 
void SetRequirements (tU64 reqs)
 

Detailed Description

Definition at line 12 of file indexed_renderer.h.

Constructor & Destructor Documentation

◆ CIndexedRenderer()

CIndexedRenderer::CIndexedRenderer ( void *  packet,
int  packetSize,
CRendererProps  caps,
CRendererProps  reqs,
int  inQuadsPerVert,
int  outQuadsPerVert,
const char *  name 
)

Definition at line 20 of file indexed_renderer.cpp.

Member Function Documentation

◆ InitContext()

void CIndexedRenderer::InitContext ( GLenum  primType,
tU32  rcChanges,
bool  userRcChanged 
)
virtual

called by the geometry manager when the default renderer context has changed, when the user context has changed, or after the renderer has been loaded (and a different renderer was in use). The renderer must record all necessary context at this point (usually by adding it to the vif1 chain) as the rendering context may have changed when it is called to actually render with Draw*Arrays().

Parameters
primTypethe primitive type to render (can be a custom type)
rcChangeschanged in the rendering context as returned by CGLContext::GetRendererContextChanged().
userRcChangedwhether the user (custom) rendering context has changed

Implements CRenderer.

Definition at line 31 of file indexed_renderer.cpp.

◆ DrawIndexedArrays()

void CIndexedRenderer::DrawIndexedArrays ( CGeometryBlock block)
virtual

Draw arrays of vertices that are accessed by index (i.e., glDrawElements)

Reimplemented from CRenderer.

Definition at line 98 of file indexed_renderer.cpp.

References CBaseRenderer::InitXferBlock(), and CBaseRenderer::XferBlock().

◆ GetPacketQwordSize()

int CIndexedRenderer::GetPacketQwordSize ( const CGeometryBlock geometry)
virtual

Estimate the amount of memory, in qwords, the packet to render "geometry" will take. (For display list cacheing.)

Implements CRenderer.

Definition at line 74 of file indexed_renderer.cpp.

◆ GetRenderContextDeps()

CRendererProps CIndexedRenderer::GetRenderContextDeps ( )
virtual

What parts of the render context are encoded into packets produced by this renderer? When the packets are cached in display lists, this cached state must remain valid to continue using the cached packet. This method returns a CRendererProps bitmask with '1' set for each property that is cached in the packet. Note that this does not include the render context kept by InitContext(); this will never be cached by ps2gl. The default renderers, for example, do not transfer normals even when specified if lighting is not enabled. The packets they generate therefore depend on whether or not lighting is enabled, so they set the "Lighting" bit.

Implements CRenderer.

Definition at line 81 of file indexed_renderer.cpp.

◆ GetCachePackets()

bool CIndexedRenderer::GetCachePackets ( const CGeometryBlock geometry)
virtual

Can the packets generated by this renderer for the given geometry be cached when called from a display list, or should they be rebuilt each time? (The default renderers, for example, don't cache packets that depend on the current normal when lighting is enabled.)

Implements CRenderer.

Definition at line 92 of file indexed_renderer.cpp.

Field Documentation

◆ ConstantVertColor

cpu_vec_4 CIndexedRenderer::ConstantVertColor
protected

Definition at line 14 of file indexed_renderer.h.


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