dungeon_crawler

annotate prototype/src/renderer.h @ 75:b05ab29cd17d

color grading done
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 22 Oct 2012 03:55:00 +0300
parents a27528035e20
children
rev   line source
nuclear@15 1 #ifndef RENDERER_H_
nuclear@15 2 #define RENDERER_H_
nuclear@15 3
nuclear@72 4 #include "colgrade.h"
nuclear@72 5
nuclear@23 6 class Level;
nuclear@23 7
nuclear@41 8 class Renderer {
nuclear@41 9 protected:
nuclear@72 10 // render target
nuclear@72 11 unsigned int fbo;
nuclear@72 12 unsigned int rend_tex, rend_depth;
nuclear@41 13 int width, height;
nuclear@72 14 int tex_xsz, tex_ysz;
nuclear@72 15
nuclear@72 16 GradePalette gradepal;
nuclear@72 17 unsigned int post_sdr;
nuclear@72 18
nuclear@72 19 virtual bool create_rtarg();
nuclear@15 20
nuclear@41 21 public:
nuclear@41 22 Renderer();
nuclear@41 23 virtual ~Renderer();
nuclear@33 24
nuclear@41 25 virtual bool init(int xsz, int ysz);
nuclear@23 26
nuclear@41 27 virtual int get_tangent_location() const;
nuclear@41 28 virtual unsigned int get_current_program() const;
nuclear@41 29
nuclear@41 30 virtual void resize(int xsz, int ysz);
nuclear@41 31
nuclear@62 32 virtual void render_pre(const Level *level) const;
nuclear@41 33 virtual void render(const Level *level) const = 0;
nuclear@62 34 virtual void render_post(const Level *level) const;
nuclear@74 35
nuclear@74 36 virtual GradePalette *get_grade_palette();
nuclear@74 37 virtual const GradePalette *get_grade_palette() const;
nuclear@41 38 };
nuclear@41 39
nuclear@41 40
nuclear@41 41 class FwdRenderer : public Renderer {
nuclear@41 42 protected:
nuclear@41 43 unsigned int sdrprog;
nuclear@41 44 int tang_attr;
nuclear@41 45
nuclear@41 46 public:
nuclear@41 47 FwdRenderer();
nuclear@41 48 ~FwdRenderer();
nuclear@41 49
nuclear@41 50 bool init(int xsz, int ysz);
nuclear@41 51
nuclear@41 52 int get_tangent_location() const;
nuclear@41 53 unsigned int get_current_program() const;
nuclear@41 54
nuclear@41 55 void render(const Level *level) const;
nuclear@41 56 };
nuclear@41 57
nuclear@41 58
nuclear@41 59 extern Renderer *rend;
nuclear@41 60
nuclear@15 61
nuclear@15 62 #endif // RENDERER_H_