2006-04-02 21:04:20 +00:00
|
|
|
#ifndef __RAS_LISTRASTERIZER_H__
|
|
|
|
#define __RAS_LISTRASTERIZER_H__
|
|
|
|
|
|
|
|
#include "RAS_MaterialBucket.h"
|
2007-11-06 18:39:16 +00:00
|
|
|
#include "RAS_VAOpenGLRasterizer.h"
|
2006-04-02 21:04:20 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2008-03-09 22:02:32 +00:00
|
|
|
class RAS_ListRasterizer;
|
2006-04-02 21:04:20 +00:00
|
|
|
class RAS_ListSlot : public KX_ListSlot
|
|
|
|
{
|
|
|
|
unsigned int m_list;
|
|
|
|
unsigned int m_flag;
|
2008-03-09 22:02:32 +00:00
|
|
|
RAS_ListRasterizer* m_rasty;
|
2006-04-02 21:04:20 +00:00
|
|
|
public:
|
2008-03-09 22:02:32 +00:00
|
|
|
RAS_ListSlot(RAS_ListRasterizer* rasty);
|
2006-04-02 21:04:20 +00:00
|
|
|
virtual ~RAS_ListSlot();
|
|
|
|
virtual void SetModified(bool mod);
|
2008-03-09 22:02:32 +00:00
|
|
|
virtual int Release();
|
2006-04-02 21:04:20 +00:00
|
|
|
|
|
|
|
void RemoveList();
|
|
|
|
void DrawList();
|
|
|
|
void EndList();
|
|
|
|
bool End();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
enum RAS_ListSlotFlags {
|
|
|
|
LIST_CREATE =1,
|
|
|
|
LIST_MODIFY =2,
|
|
|
|
LIST_STREAM =4,
|
|
|
|
LIST_NOCREATE =8,
|
|
|
|
LIST_BEGIN =16,
|
|
|
|
LIST_END =32,
|
|
|
|
LIST_REGEN =64
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::map<const vecVertexArray, RAS_ListSlot*> RAS_Lists;
|
|
|
|
|
2007-11-06 18:39:16 +00:00
|
|
|
class RAS_ListRasterizer : public RAS_VAOpenGLRasterizer
|
2006-04-02 21:04:20 +00:00
|
|
|
{
|
2007-11-06 18:39:16 +00:00
|
|
|
bool mUseVertexArrays;
|
2006-04-02 21:04:20 +00:00
|
|
|
RAS_Lists mLists;
|
|
|
|
|
|
|
|
RAS_ListSlot* FindOrAdd(const vecVertexArray& vertexarrays, KX_ListSlot** slot);
|
|
|
|
void ReleaseAlloc();
|
|
|
|
|
|
|
|
public:
|
2008-03-09 22:02:32 +00:00
|
|
|
void RemoveListSlot(RAS_ListSlot* list);
|
2007-11-06 18:39:16 +00:00
|
|
|
RAS_ListRasterizer(RAS_ICanvas* canvas, bool useVertexArrays=false, bool lock=false);
|
2006-04-02 21:04:20 +00:00
|
|
|
virtual ~RAS_ListRasterizer();
|
|
|
|
|
|
|
|
virtual void IndexPrimitives(
|
|
|
|
const vecVertexArray& vertexarrays,
|
|
|
|
const vecIndexArrays & indexarrays,
|
2008-07-10 12:47:20 +00:00
|
|
|
DrawMode mode,
|
2006-04-02 21:04:20 +00:00
|
|
|
bool useObjectColor,
|
|
|
|
const MT_Vector4& rgbacolor,
|
|
|
|
class KX_ListSlot** slot
|
|
|
|
);
|
|
|
|
|
|
|
|
virtual void IndexPrimitivesMulti(
|
|
|
|
const vecVertexArray& vertexarrays,
|
|
|
|
const vecIndexArrays & indexarrays,
|
2008-07-10 12:47:20 +00:00
|
|
|
DrawMode mode,
|
2006-04-02 21:04:20 +00:00
|
|
|
bool useObjectColor,
|
|
|
|
const MT_Vector4& rgbacolor,
|
|
|
|
class KX_ListSlot** slot
|
|
|
|
);
|
|
|
|
|
2007-11-06 18:39:16 +00:00
|
|
|
virtual bool Init();
|
|
|
|
virtual void Exit();
|
|
|
|
|
|
|
|
virtual void SetDrawingMode(int drawingmode);
|
|
|
|
|
2006-04-02 21:04:20 +00:00
|
|
|
virtual bool QueryLists(){return true;}
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|