00001
00002
00003 This file is subject to the terms and conditions of the GNU Lesser
00004 General Public License Version 2.1. See the file "COPYING" in the
00005 main directory of this archive for more details. */
00006
00007 #ifndef ps2gl_dlgmanager_h
00008 #define ps2gl_dlgmanager_h
00009
00010 #include "ps2gl/gmanager.h"
00011
00012
00013 * CDListGeomManager - the display list renderer
00014 */
00015
00016 class CDList;
00017
00018 class CDListGeomManager : public CGeomManager {
00019
00020 CDmaPacket *CurVertexBuf, *CurNormalBuf, *CurTexCoordBuf, *CurColorBuf;
00021
00022 CDList *CurDList;
00023 CGeometryBlock Geometry;
00024
00025 bool RendererMayHaveChanged;
00026
00027 void DrawBlock( CGeometryBlock &block );
00028 void CommitNewGeom();
00029
00030 void DrawingIndexedArray();
00031 void DrawingLinearArray();
00032
00033 public:
00034 CDListGeomManager( CGLContext &context );
00035 virtual ~CDListGeomManager() {}
00036
00037 void PrimChanged( unsigned char prim );
00038
00039
00040
00041 void EnableCustom( tU64 flag );
00042 void DisableCustom( tU64 flag );
00043
00044 void SetUserRenderContextChanged() { mError("not implemented yet"); }
00045
00046
00047
00048 void BeginDListDef();
00049 void EndDListDef();
00050
00051 void BeginGeom( GLenum mode );
00052 void Vertex( cpu_vec_xyzw newVert );
00053 void Normal( cpu_vec_xyz normal );
00054 void TexCoord( float u, float v );
00055 void Color( cpu_vec_xyzw color );
00056 void EndGeom();
00057 void DrawArrays( GLenum mode, int first, int count );
00058 void DrawIndexedArrays( GLenum primType,
00059 int numIndices, const unsigned char* indices,
00060 int numVertices );
00061 void Flush();
00062 };
00063
00064 #endif // ps2gl_dlgmanager_h