dungeon_crawler

annotate prototype/src/renderer.h @ 63:7f52d6310317

fixed design issue with datafile_path
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 02 Oct 2012 04:52:59 +0300
parents acfe0c0110fc
children a27528035e20
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@62 21 virtual void render_pre(const Level *level) const;
nuclear@41 22 virtual void render(const Level *level) const = 0;
nuclear@62 23 virtual void render_post(const Level *level) const;
nuclear@41 24 };
nuclear@41 25
nuclear@41 26
nuclear@41 27 class FwdRenderer : public Renderer {
nuclear@41 28 protected:
nuclear@41 29 unsigned int sdrprog;
nuclear@41 30 int tang_attr;
nuclear@41 31
nuclear@41 32 public:
nuclear@41 33 FwdRenderer();
nuclear@41 34 ~FwdRenderer();
nuclear@41 35
nuclear@41 36 bool init(int xsz, int ysz);
nuclear@41 37
nuclear@41 38 int get_tangent_location() const;
nuclear@41 39 unsigned int get_current_program() const;
nuclear@41 40
nuclear@41 41 void render(const Level *level) const;
nuclear@41 42 };
nuclear@41 43
nuclear@41 44
nuclear@41 45 extern Renderer *rend;
nuclear@41 46
nuclear@15 47
nuclear@15 48 #endif // RENDERER_H_