2011-02-22 12:42:55 +00:00
|
|
|
|
|
|
|
/** \file RAS_ListRasterizer.h
|
|
|
|
* \ingroup bgerastogl
|
|
|
|
*/
|
|
|
|
|
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>
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
#include <map>
|
2006-04-02 21:04:20 +00:00
|
|
|
|
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
|
|
|
|
{
|
2009-06-08 20:08:19 +00:00
|
|
|
friend class RAS_ListRasterizer;
|
2006-04-02 21:04:20 +00:00
|
|
|
unsigned int m_list;
|
|
|
|
unsigned int m_flag;
|
2010-03-24 22:55:45 +00:00
|
|
|
unsigned int m_matnr;
|
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,
|
2009-06-08 20:08:19 +00:00
|
|
|
LIST_REGEN =64,
|
|
|
|
LIST_DERIVEDMESH=128,
|
2006-04-02 21:04:20 +00:00
|
|
|
};
|
|
|
|
|
2009-06-08 20:08:19 +00:00
|
|
|
struct DerivedMesh;
|
|
|
|
|
|
|
|
typedef std::map<RAS_DisplayArrayList, RAS_ListSlot*> RAS_ArrayLists;
|
2010-03-24 22:55:45 +00:00
|
|
|
typedef std::vector<RAS_ListSlot*> RAS_ListSlots; // indexed by material slot number
|
|
|
|
typedef std::map<DerivedMesh*, RAS_ListSlots*> RAS_DerivedMeshLists;
|
2006-04-02 21:04:20 +00:00
|
|
|
|
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;
|
2009-06-08 20:08:19 +00:00
|
|
|
bool mATI;
|
|
|
|
RAS_ArrayLists mArrayLists;
|
|
|
|
RAS_DerivedMeshLists mDerivedMeshLists;
|
2006-04-02 21:04:20 +00:00
|
|
|
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
RAS_ListSlot* FindOrAdd(class RAS_MeshSlot& ms);
|
2006-04-02 21:04:20 +00:00
|
|
|
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();
|
|
|
|
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
virtual void IndexPrimitives(class RAS_MeshSlot& ms);
|
|
|
|
virtual void IndexPrimitivesMulti(class RAS_MeshSlot& ms);
|
2006-04-02 21:04:20 +00:00
|
|
|
|
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;}
|
2009-08-18 15:37:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef WITH_CXX_GUARDEDALLOC
|
|
|
|
public:
|
2010-06-06 01:15:44 +00:00
|
|
|
void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_ListRasterizer"); }
|
2009-08-18 15:37:31 +00:00
|
|
|
void operator delete( void *mem ) { MEM_freeN(mem); }
|
|
|
|
#endif
|
2006-04-02 21:04:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|