dungeon_crawler
view 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 |
line source
1 #ifndef RENDERER_H_
2 #define RENDERER_H_
4 #include "colgrade.h"
6 class Level;
8 class Renderer {
9 protected:
10 // render target
11 unsigned int fbo;
12 unsigned int rend_tex, rend_depth;
13 int width, height;
14 int tex_xsz, tex_ysz;
16 GradePalette gradepal;
17 unsigned int post_sdr;
19 virtual bool create_rtarg();
21 public:
22 Renderer();
23 virtual ~Renderer();
25 virtual bool init(int xsz, int ysz);
27 virtual int get_tangent_location() const;
28 virtual unsigned int get_current_program() const;
30 virtual void resize(int xsz, int ysz);
32 virtual void render_pre(const Level *level) const;
33 virtual void render(const Level *level) const = 0;
34 virtual void render_post(const Level *level) const;
36 virtual GradePalette *get_grade_palette();
37 virtual const GradePalette *get_grade_palette() const;
38 };
41 class FwdRenderer : public Renderer {
42 protected:
43 unsigned int sdrprog;
44 int tang_attr;
46 public:
47 FwdRenderer();
48 ~FwdRenderer();
50 bool init(int xsz, int ysz);
52 int get_tangent_location() const;
53 unsigned int get_current_program() const;
55 void render(const Level *level) const;
56 };
59 extern Renderer *rend;
62 #endif // RENDERER_H_