Welcome to mirror list, hosted at ThFree Co, Russian Federation.

RAS_ListRasterizer.h « RAS_OpenGLRasterizer « Rasterizer « gameengine « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5e1c662bc17c27a54d7127c7ca91294cb492f1b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78

/** \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=false, int storage=RAS_AUTO_STORAGE);
	virtual ~RAS_ListRasterizer();

	virtual void	IndexPrimitives(class RAS_MeshSlot& ms);
	virtual void	IndexPrimitivesMulti(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