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

CRenderer Class Reference

This class defines the interface for renderers. More...

#include <renderer.h>

Inheritance diagram for CRenderer::

CBaseRenderer CIndexedRenderer CLinearRenderer List of all members.

Public Methods

virtual tU64 GetCapabilities () const
virtual tU64 GetRequirements () const
virtual void InitContext (GLenum primType, tU32 rcChanges, bool userRcChanged)=0
 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 Load ()=0
 Load the renderer into vu0/vu1 memory. More...

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

virtual void DrawIndexedArrays (CGeometryBlock &block)
 Draw arrays of vertices that are accessed by index (i.e., glDrawElements). More...

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

virtual CRendererProps GetRenderContextDeps ()=0
 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 int GetPacketQwordSize (const CGeometryBlock &geometry)=0
 Estimate the amount of memory, in qwords, the packet to render "geometry" will take. (For display list cacheing.). More...

virtual const char * GetName ()=0
 Return a pointer to the text name of this renderer. More...


Protected Methods

 CRenderer ()
 CRenderer (tU64 caps, tU64 reqs)
void SetCapabilities (tU64 caps)
void SetRequirements (tU64 reqs)

Protected Attributes

tU64 Capabilities
tU64 Requirements

Detailed Description

This class defines the interface for renderers.

Note that it contains pure virtual methods and so cannot be instantiated.

Definition at line 87 of file renderer.h.


Constructor & Destructor Documentation

CRenderer::CRenderer   [inline, protected]
 

Definition at line 93 of file renderer.h.

CRenderer::CRenderer tU64    caps,
tU64    reqs
[inline, protected]
 

Definition at line 94 of file renderer.h.


Member Function Documentation

virtual void CRenderer::DrawIndexedArrays CGeometryBlock   block [inline, virtual]
 

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

Reimplemented in CIndexedRenderer.

Definition at line 122 of file renderer.h.

Referenced by CImmGeomManager::Flush(), and CDrawIndexedArraysCmd::Play().

virtual void CRenderer::DrawLinearArrays CGeometryBlock   block [inline, virtual]
 

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

Reimplemented in CLinearRenderer.

Definition at line 119 of file renderer.h.

Referenced by CImmGeomManager::Flush(), and CDrawArraysCmd::Play().

virtual bool CRenderer::GetCachePackets const CGeometryBlock   geometry [pure 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 in CIndexedRenderer, and CLinearRenderer.

Referenced by CDrawArraysCmd::Play().

virtual tU64 CRenderer::GetCapabilities   const [inline, virtual]
 

Definition at line 100 of file renderer.h.

Referenced by CRendererManager::RegisterUserRenderer().

virtual const char* CRenderer::GetName   [pure virtual]
 

Return a pointer to the text name of this renderer.

Reimplemented in CBaseRenderer.

virtual int CRenderer::GetPacketQwordSize const CGeometryBlock   geometry [pure virtual]
 

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

Reimplemented in CIndexedRenderer, and CLinearRenderer.

Referenced by CDrawArraysCmd::Play().

virtual CRendererProps CRenderer::GetRenderContextDeps   [pure 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 in CIndexedRenderer, and CLinearRenderer.

Referenced by CDrawArraysCmd::Play().

virtual tU64 CRenderer::GetRequirements   const [inline, virtual]
 

Definition at line 101 of file renderer.h.

Referenced by CRendererManager::RegisterUserRenderer().

virtual void CRenderer::InitContext GLenum    primType,
tU32    rcChanges,
bool    userRcChanged
[pure 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 in CIndexedRenderer, and CLinearRenderer.

Referenced by CImmGeomManager::SyncRendererContext().

virtual void CRenderer::Load   [pure virtual]
 

Load the renderer into vu0/vu1 memory.

Reimplemented in CBaseRenderer.

void CRenderer::SetCapabilities tU64    caps [inline, protected]
 

Definition at line 96 of file renderer.h.

void CRenderer::SetRequirements tU64    reqs [inline, protected]
 

Definition at line 97 of file renderer.h.


Member Data Documentation

tU64 CRenderer::Capabilities [protected]
 

Definition at line 89 of file renderer.h.

tU64 CRenderer::Requirements [protected]
 

Definition at line 90 of file renderer.h.


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