dungeon_crawler
annotate prototype/src/renderer.h @ 53:1ea56011c1ff
stuff + streaming start
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 19 Sep 2012 01:08:41 +0300 |
parents | 862461b686f4 |
children | f71381c9e245 |
rev | line source |
---|---|
nuclear@15 | 1 #ifndef RENDERER_H_ |
nuclear@15 | 2 #define RENDERER_H_ |
nuclear@15 | 3 |
nuclear@23 | 4 class Level; |
nuclear@23 | 5 |
nuclear@41 | 6 class Renderer { |
nuclear@41 | 7 protected: |
nuclear@41 | 8 int width, height; |
nuclear@15 | 9 |
nuclear@41 | 10 public: |
nuclear@41 | 11 Renderer(); |
nuclear@41 | 12 virtual ~Renderer(); |
nuclear@33 | 13 |
nuclear@41 | 14 virtual bool init(int xsz, int ysz); |
nuclear@23 | 15 |
nuclear@41 | 16 virtual int get_tangent_location() const; |
nuclear@41 | 17 virtual unsigned int get_current_program() const; |
nuclear@41 | 18 |
nuclear@41 | 19 virtual void resize(int xsz, int ysz); |
nuclear@41 | 20 |
nuclear@41 | 21 virtual void render(const Level *level) const = 0; |
nuclear@41 | 22 }; |
nuclear@41 | 23 |
nuclear@41 | 24 |
nuclear@41 | 25 class FwdRenderer : public Renderer { |
nuclear@41 | 26 protected: |
nuclear@41 | 27 unsigned int sdrprog; |
nuclear@41 | 28 int tang_attr; |
nuclear@41 | 29 |
nuclear@41 | 30 public: |
nuclear@41 | 31 FwdRenderer(); |
nuclear@41 | 32 ~FwdRenderer(); |
nuclear@41 | 33 |
nuclear@41 | 34 bool init(int xsz, int ysz); |
nuclear@41 | 35 |
nuclear@41 | 36 int get_tangent_location() const; |
nuclear@41 | 37 unsigned int get_current_program() const; |
nuclear@41 | 38 |
nuclear@41 | 39 void render(const Level *level) const; |
nuclear@41 | 40 }; |
nuclear@41 | 41 |
nuclear@41 | 42 |
nuclear@41 | 43 extern Renderer *rend; |
nuclear@41 | 44 |
nuclear@15 | 45 |
nuclear@15 | 46 #endif // RENDERER_H_ |