Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

CLinearRenderer Class Reference

#include <linear_renderer.h>

Inheritance diagram for CLinearRenderer::

CBaseRenderer CRenderer List of all members.

Public Methods

 CLinearRenderer (void *packet, CRendererProps caps, CRendererProps reqs, int inQuadsPerVert, int outQuadsPerVert, int inGeomOffset, int inGeomBufSize, const char *name)
 CLinearRenderer (void *packet, int inQuadsPerVert, int outQuadsPerVert, int inGeomOffset, int inGeomBufSize, const char *name)
virtual void InitContext (GLenum primType, tU32 rcChanges, bool userRcChanged)
 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:
primType  the primitive type to render (can be a custom type)
rcChanges  changed in the rendering context as returned by CGLContext::GetRendererContextChanged().
userRcChanged  whether the user (custom) rendering context has changed.
More...


virtual void DrawLinearArrays (CGeometryBlock &block)
 Draw arrays of vertices that are accessed linearly (i.e., glDrawArrays). More...

virtual int GetPacketQwordSize (const CGeometryBlock &geometry)
 Estimate the amount of memory, in qwords, the packet to render "geometry" will take. (For display list cacheing.). More...

virtual CRendererProps GetRenderContextDeps ()
 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. More...

virtual bool GetCachePackets (const CGeometryBlock &geometry)
 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.). More...


Protected Methods

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 Attributes

int InputGeomBufSize

Constructor & Destructor Documentation

CLinearRenderer::CLinearRenderer void *    packet,
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::CLinearRenderer void *    packet,
int    inQuadsPerVert,
int    outQuadsPerVert,
int    inGeomOffset,
int    inGeomBufSize,
const char *    name
[inline]
 

Definition at line 50 of file linear_renderer.h.


Member Function Documentation

void CLinearRenderer::DrawBlock CVifSCDmaPacket &    packet,
CGeometryBlock   block,
int    maxVertsPerBuffer
[protected]
 

Definition at line 101 of file linear_renderer.cpp.

Referenced by DrawLinearArrays().

void CLinearRenderer::DrawLinearArrays CGeometryBlock   block [virtual]
 

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

Reimplemented from CRenderer.

Definition at line 24 of file linear_renderer.cpp.

void CLinearRenderer::FindNumBuffers int    numToAdd,
int    numVertsToRestart,
int    numVertsAlreadyInFirstBuffer,
int    maxVertsPerBuffer,
int &    numVertsFirstBuffer,
int &    numVertsLastBuffer,
int &    numBuffers
[protected]
 

Definition at line 258 of file linear_renderer.cpp.

Referenced by DrawBlock().

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

Definition at line 239 of file linear_renderer.cpp.

Referenced by DrawBlock().

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.).

Reimplemented from CRenderer.

Definition at line 94 of file linear_renderer.cpp.

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.).

Reimplemented from CRenderer.

Definition at line 75 of file linear_renderer.cpp.

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.

Reimplemented from CRenderer.

Definition at line 82 of file linear_renderer.cpp.

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:
primType  the primitive type to render (can be a custom type)
rcChanges  changed in the rendering context as returned by CGLContext::GetRendererContextChanged().
userRcChanged  whether the user (custom) rendering context has changed.

Reimplemented from CRenderer.

Definition at line 54 of file linear_renderer.cpp.

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

Definition at line 293 of file linear_renderer.cpp.

Referenced by FinishBuffer().


Member Data Documentation

int CLinearRenderer::InputGeomBufSize [protected]
 

Definition at line 19 of file linear_renderer.h.


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