blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h
Mitchell Stokes fe2f3a131d OpenGL/BGE: Remove RAS_StorageIM (glBegin/glEnd rendering of mesh data)
The only use we had for RAS_StorageIM was to render derived meshes using
Blender's mesh drawing. This is now handled as a special case in
RAS_OpenGLRasterizer instead of in RAS_StorageIM.

We are now left with RAS_StorageVA and RAS_StorageVBO. At the moment
vertex arrays are still the default since our vertex array with display
lists implementation is still much faster than our VBO code in a lot of
cases. As we improve our VBO code, we can drop vertex arrays since
Blender's minimum OpenGL version is being bumped up to 2.1, which
supports VBOs.
2015-12-07 19:05:09 -08:00

78 lines
1.6 KiB
C++

/** \file RAS_ListRasterizer.h
* \ingroup bgerastogl
*/
#ifndef __RAS_LISTRASTERIZER_H__
#define __RAS_LISTRASTERIZER_H__
#include "RAS_MaterialBucket.h"
#include "RAS_OpenGLRasterizer.h"
#include <vector>
#include <map>
class RAS_ListRasterizer;
class RAS_ListSlot : public KX_ListSlot
{
friend class RAS_ListRasterizer;
unsigned int m_list;
unsigned int m_flag;
unsigned int m_matnr;
RAS_ListRasterizer* m_rasty;
public:
RAS_ListSlot(RAS_ListRasterizer* rasty);
virtual ~RAS_ListSlot();
virtual void SetModified(bool mod);
virtual int Release();
void RemoveList();
void DrawList();
void EndList();
bool End();
};
enum RAS_ListSlotFlags {
LIST_CREATE =1,
LIST_MODIFY =2,
LIST_BEGIN =4,
LIST_END =8,
LIST_DERIVEDMESH=16,
};
struct DerivedMesh;
typedef std::map<RAS_DisplayArrayList, RAS_ListSlot*> RAS_ArrayLists;
typedef std::vector<RAS_ListSlot*> RAS_ListSlots; // indexed by material slot number
typedef std::map<DerivedMesh*, RAS_ListSlots*> RAS_DerivedMeshLists;
class RAS_ListRasterizer : public RAS_OpenGLRasterizer
{
RAS_ArrayLists mArrayLists;
RAS_DerivedMeshLists mDerivedMeshLists;
RAS_ListSlot* FindOrAdd(class RAS_MeshSlot& ms);
void ReleaseAlloc();
public:
void RemoveListSlot(RAS_ListSlot* list);
RAS_ListRasterizer(RAS_ICanvas* canvas, bool lock, RAS_STORAGE_TYPE storage);
virtual ~RAS_ListRasterizer();
virtual void IndexPrimitives(class RAS_MeshSlot& ms);
virtual bool Init();
virtual void Exit();
virtual void SetDrawingMode(int drawingmode);
virtual bool QueryLists() {return true;}
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_ListRasterizer")
#endif
};
#endif