Angel 3.2
A 2D Game Prototyping Engine
DebugDraw.h
1 #include "Vector2.h"
2 
3 /* abstract */ class DebugDrawBase
4 {
5 protected:
6  friend class World;
7  virtual ~DebugDrawBase() {}
8  virtual void Draw() = 0;
9 
10  void SetupDraw()
11  {
12  glColor4f( _color.R, _color.G, _color.B, _color.A );
13  }
14 
15  float _timeRemaining;
16  bool _bPermanent;
17  Color _color;
18 };
19 
20 class DebugLine : public DebugDrawBase
21 {
22 protected:
23  friend class World;
24 
25  virtual void Draw()
26  {
27  glEnableClientState(GL_VERTEX_ARRAY);
28  glVertexPointer(2, GL_FLOAT, 0, _points);
29  glDrawArrays(GL_LINES, 0, 2);
30  }
31 
32  float _points[4];
33 };
34 
35 typedef std::vector< DebugDrawBase* >::iterator DebugDrawIterator;
36