PS2GL
OpenGL*-like API for the PS2
Loading...
Searching...
No Matches
linear_renderer.h
1/* Copyright (C) 2000,2001,2002 Sony Computer Entertainment America
2
3 This file is subject to the terms and conditions of the GNU Lesser
4 General Public License Version 2.1. See the file "COPYING" in the
5 main directory of this archive for more details. */
6
7#ifndef linear_renderer_h
8#define linear_renderer_h
9
10#include "ps2s/packet.h"
11
12#include "GL/gl.h"
13#include "ps2gl/base_renderer.h"
14#include "ps2gl/immgmanager.h"
15#include "ps2gl/renderer.h"
16
18protected:
19 int InputGeomBufSize;
20
21 // called by DrawArrays
22 void DrawBlock(CVifSCDmaPacket& packet, CGeometryBlock& block, int maxVertsPerBuffer);
23
24 // used by DrawBlock
25 void FindNumBuffers(int numToAdd, int numVertsToRestart,
26 int numVertsAlreadyInFirstBuffer, int maxVertsPerBuffer,
27 int& numVertsFirstBuffer, int& numVertsLastBuffer,
28 int& numBuffers);
29
30 // used by DrawBlock
31 void FinishBuffer(CVifSCDmaPacket& packet, int numVertsToBreakStrip,
32 int numVertsInBuffer, int vu1QuadsPerVert,
33 int numStripsInBuffer, unsigned short* stripOffsets);
34
35 // used by FinishBuffer
36 void XferBufferHeader(CVifSCDmaPacket& packet, int numVertsToBreakStrip,
37 int numVerts,
38 int numStripsInBuffer, unsigned short* stripOffsets);
39
40public:
41 CLinearRenderer(void* packet, int packetSize, CRendererProps caps, CRendererProps reqs,
42 int inQuadsPerVert, int outQuadsPerVert,
43 int inGeomOffset, int inGeomBufSize,
44 const char* name)
45 : CBaseRenderer(packet, packetSize, caps, reqs,
46 inQuadsPerVert, outQuadsPerVert, inGeomOffset, name)
47 , InputGeomBufSize(inGeomBufSize)
48 {
49 }
50
51 CLinearRenderer(void* packet, int packetSize,
52 int inQuadsPerVert, int outQuadsPerVert,
53 int inGeomOffset, int inGeomBufSize,
54 const char* name)
55 : CBaseRenderer(packet, packetSize, inQuadsPerVert, outQuadsPerVert, inGeomOffset, name)
56 , InputGeomBufSize(inGeomBufSize)
57 {
58 }
59
60 virtual void InitContext(GLenum primType, tU32 rcChanges, bool userRcChanged);
61 virtual void DrawLinearArrays(CGeometryBlock& block);
62 virtual int GetPacketQwordSize(const CGeometryBlock& geometry);
64 virtual bool GetCachePackets(const CGeometryBlock& geometry);
65};
66
67#endif // linear_renderer_h
virtual void InitContext(GLenum primType, tU32 rcChanges, bool userRcChanged)
virtual int GetPacketQwordSize(const CGeometryBlock &geometry)
virtual CRendererProps GetRenderContextDeps()
virtual bool GetCachePackets(const CGeometryBlock &geometry)
virtual void DrawLinearArrays(CGeometryBlock &block)
Draw arrays of vertices that are accessed linearly (i.e., glDrawArrays)