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

Public Member Functions

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 InitContext (GLenum primType, tU32 rcChanges, bool userRcChanged)=0
 
virtual void DrawLinearArrays (CGeometryBlock &block)
 Draw arrays of vertices that are accessed linearly (i.e., glDrawArrays)
 
virtual void DrawIndexedArrays (CGeometryBlock &block)
 Draw arrays of vertices that are accessed by index (i.e., glDrawElements)
 
virtual bool GetCachePackets (const CGeometryBlock &geometry)=0
 
virtual CRendererProps GetRenderContextDeps ()=0
 
virtual int GetPacketQwordSize (const CGeometryBlock &geometry)=0
 

Protected Member Functions

 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)
 

Protected Attributes

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
 

Detailed Description

Definition at line 19 of file base_renderer.h.

Constructor & Destructor Documentation

◆ CBaseRenderer() [1/2]

CBaseRenderer::CBaseRenderer ( void *  packet,
int  packetSize,
int  inQuadsPerVert,
int  outQuadsPerVert,
int  inGeomOffset,
const char *  name 
)
inlineprotected

Definition at line 45 of file base_renderer.h.

◆ CBaseRenderer() [2/2]

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

Definition at line 63 of file base_renderer.h.

Member Function Documentation

◆ SetVifDoubleBuffered()

void CBaseRenderer::SetVifDoubleBuffered ( bool  db)
inlineprotected

Definition at line 82 of file base_renderer.h.

◆ GetUnpackAttribs()

void CBaseRenderer::GetUnpackAttribs ( int  numWords,
unsigned int &  mode,
Vifs::tMask &  mask 
)
protected

Definition at line 25 of file base_renderer.cpp.

◆ InitXferBlock()

void CBaseRenderer::InitXferBlock ( CVifSCDmaPacket &  packet,
int  wordsPerVertex,
int  wordsPerNormal,
int  wordsPerTex,
int  wordsPerColor 
)
protected

Caches some data frequently used by XferBlock(), sets up row register. The parameters wordsPerNormal, wordsPerTex, and wordsPerColor should be zero if the application has not given normals, texture coords, or colors.

Definition at line 60 of file base_renderer.cpp.

Referenced by CIndexedRenderer::DrawIndexedArrays(), and CLinearRenderer::DrawLinearArrays().

◆ XferBlock()

void CBaseRenderer::XferBlock ( CVifSCDmaPacket &  packet,
const void *  vertices,
const void *  normals,
const void *  texCoords,
const void *  colors,
int  vu1Offset,
int  firstElement,
int  numToAdd 
)
protected

Transfers a block of geometry to vu0/vu1 using packet, where "geometry" means vertices and zero or more normals, texture coordinates, and colors. Note that you MUST set the vif1 write mode correctly before calling XferBlock!! (e.g., Stcycl(1, vu1QuadsPerVert)) normals, texCoords, and colors should be NULL if not provided.

Parameters
vu1Offsetoffset into vu1 memory in quadwords
firstElementthe starting "offset" into the vertex, normal, etc. arrays (for example: this would be "2" to start draw from the 3rd element)

Definition at line 114 of file base_renderer.cpp.

Referenced by CIndexedRenderer::DrawIndexedArrays().

◆ XferVectors()

void CBaseRenderer::XferVectors ( CVifSCDmaPacket &  packet,
unsigned int *  dataStart,
int  startOffset,
int  numVectors,
int  wordsPerVec,
Vifs::tMask  unpackMask,
tU32  unpackMode,
int  vu1MemOffset 
)
protected

Definition at line 432 of file base_renderer.cpp.

◆ AddVu1RendererContext()

void CBaseRenderer::AddVu1RendererContext ( CVifSCDmaPacket &  packet,
GLenum  primType,
int  vu1Offset 
)
protected

Definition at line 193 of file base_renderer.cpp.

◆ BuildGiftag()

tGifTag CBaseRenderer::BuildGiftag ( GLenum  primType)
protected

Definition at line 378 of file base_renderer.cpp.

◆ CacheRendererState()

void CBaseRenderer::CacheRendererState ( )
protected

Definition at line 394 of file base_renderer.cpp.

◆ GetMaxColorValue()

float CBaseRenderer::GetMaxColorValue ( bool  texEnabled)
inlineprotected

Definition at line 109 of file base_renderer.h.

◆ Load()

void CBaseRenderer::Load ( )
virtual

Load the renderer into vu0/vu1 memory.

Implements CRenderer.

Definition at line 401 of file base_renderer.cpp.

◆ GetName()

virtual const char * CBaseRenderer::GetName ( )
inlinevirtual

Return a pointer to the text name of this renderer.

Implements CRenderer.

Definition at line 119 of file base_renderer.h.

Field Documentation

◆ XferVertices

bool CBaseRenderer::XferVertices
protected

Definition at line 22 of file base_renderer.h.

◆ XferColors

bool CBaseRenderer::XferColors
protected

Definition at line 22 of file base_renderer.h.

◆ XferNormals

bool CBaseRenderer::XferNormals
protected

Definition at line 22 of file base_renderer.h.

◆ XferTexCoords

bool CBaseRenderer::XferTexCoords
protected

Definition at line 22 of file base_renderer.h.

◆ VifDoubleBuffered

bool CBaseRenderer::VifDoubleBuffered
protected

Definition at line 24 of file base_renderer.h.

◆ CurTexCoord

float CBaseRenderer::CurTexCoord[2]
protected

Definition at line 27 of file base_renderer.h.

◆ CurNormal

cpu_vec_xyz CBaseRenderer::CurNormal
protected

Definition at line 28 of file base_renderer.h.

◆ TexCoordBuf

CDmaPacket* CBaseRenderer::TexCoordBuf
protected

Definition at line 29 of file base_renderer.h.

◆ NormalBuf

CDmaPacket * CBaseRenderer::NormalBuf
protected

Definition at line 29 of file base_renderer.h.

◆ WordsPerVertex

int CBaseRenderer::WordsPerVertex
protected

Definition at line 31 of file base_renderer.h.

◆ WordsPerNormal

int CBaseRenderer::WordsPerNormal
protected

Definition at line 31 of file base_renderer.h.

◆ WordsPerTexCoord

int CBaseRenderer::WordsPerTexCoord
protected

Definition at line 31 of file base_renderer.h.

◆ WordsPerColor

int CBaseRenderer::WordsPerColor
protected

Definition at line 31 of file base_renderer.h.

◆ VertexUnpackMode

unsigned int CBaseRenderer::VertexUnpackMode
protected

Definition at line 32 of file base_renderer.h.

◆ NormalUnpackMode

unsigned int CBaseRenderer::NormalUnpackMode
protected

Definition at line 32 of file base_renderer.h.

◆ TexCoordUnpackMode

unsigned int CBaseRenderer::TexCoordUnpackMode
protected

Definition at line 33 of file base_renderer.h.

◆ ColorUnpackMode

unsigned int CBaseRenderer::ColorUnpackMode
protected

Definition at line 33 of file base_renderer.h.

◆ VertexUnpackMask

Vifs::tMask CBaseRenderer::VertexUnpackMask
protected

Definition at line 34 of file base_renderer.h.

◆ NormalUnpackMask

Vifs::tMask CBaseRenderer::NormalUnpackMask
protected

Definition at line 34 of file base_renderer.h.

◆ TexCoordUnpackMask

Vifs::tMask CBaseRenderer::TexCoordUnpackMask
protected

Definition at line 35 of file base_renderer.h.

◆ ColorUnpackMask

Vifs::tMask CBaseRenderer::ColorUnpackMask
protected

Definition at line 35 of file base_renderer.h.

◆ InputQuadsPerVert

int CBaseRenderer::InputQuadsPerVert
protected

Definition at line 37 of file base_renderer.h.

◆ OutputQuadsPerVert

int CBaseRenderer::OutputQuadsPerVert
protected

Definition at line 37 of file base_renderer.h.

◆ InputGeomOffset

int CBaseRenderer::InputGeomOffset
protected

Definition at line 38 of file base_renderer.h.

◆ MicrocodePacket

void* CBaseRenderer::MicrocodePacket
protected

Definition at line 40 of file base_renderer.h.

◆ MicrocodePacketSize

int CBaseRenderer::MicrocodePacketSize
protected

Definition at line 41 of file base_renderer.h.

◆ Name

const char* CBaseRenderer::Name
protected

Definition at line 43 of file base_renderer.h.


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