dungeon_crawler

view prototype/src/renderer.h @ 72:a27528035e20

- re-organized the renderer classes a bit wrt final render-target - implemented identity color-grading palette for now - broke particle systems.... - removed multipass renderer
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 19 Oct 2012 02:45:57 +0300
parents f71381c9e245
children 5981917093ff
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;
35 };
38 class FwdRenderer : public Renderer {
39 protected:
40 unsigned int sdrprog;
41 int tang_attr;
43 public:
44 FwdRenderer();
45 ~FwdRenderer();
47 bool init(int xsz, int ysz);
49 int get_tangent_location() const;
50 unsigned int get_current_program() const;
52 void render(const Level *level) const;
53 };
56 extern Renderer *rend;
59 #endif // RENDERER_H_