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

Public Member Functions

 CLinearRenderer (void *packet, int packetSize, CRendererProps caps, CRendererProps reqs, int inQuadsPerVert, int outQuadsPerVert, int inGeomOffset, int inGeomBufSize, const char *name)
 
 CLinearRenderer (void *packet, int packetSize, int inQuadsPerVert, int outQuadsPerVert, int inGeomOffset, int inGeomBufSize, const char *name)
 
virtual void InitContext (GLenum primType, tU32 rcChanges, bool userRcChanged)
 
virtual void DrawLinearArrays (CGeometryBlock &block)
 Draw arrays of vertices that are accessed linearly (i.e., glDrawArrays)
 
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 DrawIndexedArrays (CGeometryBlock &block)
 Draw arrays of vertices that are accessed by index (i.e., glDrawElements)
 

Protected Member Functions

void DrawBlock (CVifSCDmaPacket &packet, CGeometryBlock &block, int maxVertsPerBuffer)
 
void FindNumBuffers (int numToAdd, int numVertsToRestart, int numVertsAlreadyInFirstBuffer, int maxVertsPerBuffer, int &numVertsFirstBuffer, int &numVertsLastBuffer, int &numBuffers)
 
void FinishBuffer (CVifSCDmaPacket &packet, int numVertsToBreakStrip, int numVertsInBuffer, int vu1QuadsPerVert, int numStripsInBuffer, unsigned short *stripOffsets)
 
void XferBufferHeader (CVifSCDmaPacket &packet, int numVertsToBreakStrip, int numVerts, int numStripsInBuffer, unsigned short *stripOffsets)
 
- 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)
 

Protected Attributes

int InputGeomBufSize
 
- 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
 

Detailed Description

Definition at line 17 of file linear_renderer.h.

Constructor & Destructor Documentation

◆ CLinearRenderer() [1/2]

CLinearRenderer::CLinearRenderer ( void *  packet,
int  packetSize,
CRendererProps  caps,
CRendererProps  reqs,
int  inQuadsPerVert,
int  outQuadsPerVert,
int  inGeomOffset,
int  inGeomBufSize,
const char *  name 
)
inline

Definition at line 41 of file linear_renderer.h.

◆ CLinearRenderer() [2/2]

CLinearRenderer::CLinearRenderer ( void *  packet,
int  packetSize,
int  inQuadsPerVert,
int  outQuadsPerVert,
int  inGeomOffset,
int  inGeomBufSize,
const char *  name 
)
inline

Definition at line 51 of file linear_renderer.h.

Member Function Documentation

◆ DrawBlock()

void CLinearRenderer::DrawBlock ( CVifSCDmaPacket &  packet,
CGeometryBlock block,
int  maxVertsPerBuffer 
)
protected

Definition at line 96 of file linear_renderer.cpp.

◆ FindNumBuffers()

void CLinearRenderer::FindNumBuffers ( int  numToAdd,
int  numVertsToRestart,
int  numVertsAlreadyInFirstBuffer,
int  maxVertsPerBuffer,
int &  numVertsFirstBuffer,
int &  numVertsLastBuffer,
int &  numBuffers 
)
protected

Definition at line 249 of file linear_renderer.cpp.

◆ FinishBuffer()

void CLinearRenderer::FinishBuffer ( CVifSCDmaPacket &  packet,
int  numVertsToBreakStrip,
int  numVertsInBuffer,
int  vu1QuadsPerVert,
int  numStripsInBuffer,
unsigned short *  stripOffsets 
)
protected

Definition at line 231 of file linear_renderer.cpp.

◆ XferBufferHeader()

void CLinearRenderer::XferBufferHeader ( CVifSCDmaPacket &  packet,
int  numVertsToBreakStrip,
int  numVerts,
int  numStripsInBuffer,
unsigned short *  stripOffsets 
)
protected

Definition at line 282 of file linear_renderer.cpp.

◆ InitContext()

void CLinearRenderer::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 52 of file linear_renderer.cpp.

◆ DrawLinearArrays()

void CLinearRenderer::DrawLinearArrays ( CGeometryBlock block)
virtual

Draw arrays of vertices that are accessed linearly (i.e., glDrawArrays)

Reimplemented from CRenderer.

Definition at line 23 of file linear_renderer.cpp.

References CBaseRenderer::InitXferBlock().

◆ GetPacketQwordSize()

int CLinearRenderer::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 72 of file linear_renderer.cpp.

◆ GetRenderContextDeps()

CRendererProps CLinearRenderer::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 79 of file linear_renderer.cpp.

◆ GetCachePackets()

bool CLinearRenderer::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 90 of file linear_renderer.cpp.

Field Documentation

◆ InputGeomBufSize

int CLinearRenderer::InputGeomBufSize
protected

Definition at line 19 of file linear_renderer.h.


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