PS2GL
OpenGL*-like API for the PS2
|
#include <renderer.h>
Public Member Functions | |
virtual tU64 | GetCapabilities () const |
virtual tU64 | GetRequirements () const |
virtual void | InitContext (GLenum primType, tU32 rcChanges, bool userRcChanged)=0 |
virtual void | Load ()=0 |
Load the renderer into vu0/vu1 memory. | |
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 |
virtual const char * | GetName ()=0 |
Return a pointer to the text name of this renderer. | |
Protected Member Functions | |
CRenderer (tU64 caps, tU64 reqs) | |
void | SetCapabilities (tU64 caps) |
void | SetRequirements (tU64 reqs) |
Protected Attributes | |
tU64 | Capabilities |
tU64 | Requirements |
This class defines the interface for renderers. Note that it contains pure virtual methods and so cannot be instantiated.
Definition at line 89 of file renderer.h.
|
inlineprotected |
Definition at line 95 of file renderer.h.
|
inlineprotected |
Definition at line 96 of file renderer.h.
|
inlineprotected |
Definition at line 102 of file renderer.h.
|
inlineprotected |
Definition at line 103 of file renderer.h.
|
inlinevirtual |
Definition at line 106 of file renderer.h.
|
inlinevirtual |
Definition at line 107 of file renderer.h.
|
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().
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 |
Implemented in CIndexedRenderer, and CLinearRenderer.
|
pure virtual |
Load the renderer into vu0/vu1 memory.
Implemented in CBaseRenderer.
|
inlinevirtual |
Draw arrays of vertices that are accessed linearly (i.e., glDrawArrays)
Reimplemented in CLinearRenderer.
Definition at line 125 of file renderer.h.
|
inlinevirtual |
Draw arrays of vertices that are accessed by index (i.e., glDrawElements)
Reimplemented in CIndexedRenderer.
Definition at line 130 of file renderer.h.
|
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.)
Implemented in CIndexedRenderer, and CLinearRenderer.
|
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.
Implemented in CIndexedRenderer, and CLinearRenderer.
|
pure virtual |
Estimate the amount of memory, in qwords, the packet to render "geometry" will take. (For display list cacheing.)
Implemented in CIndexedRenderer, and CLinearRenderer.
|
pure virtual |
Return a pointer to the text name of this renderer.
Implemented in CBaseRenderer.
Referenced by pglGetCurRendererName().
|
protected |
Definition at line 91 of file renderer.h.
|
protected |
Definition at line 92 of file renderer.h.