diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-12-14 13:54:34 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-12-14 13:54:34 +0100 |
commit | ff7b7c8838f55dc0f2e76f903630f1d3d2941d5a (patch) | |
tree | 2c2f053b84251c9216a851a26edac4bc17c607bb /Renderer.h | |
parent | da66d49b8a7bcc808df201bee5c7cb787b6f30b7 (diff) | |
download | zoom++-ff7b7c8838f55dc0f2e76f903630f1d3d2941d5a.tar zoom++-ff7b7c8838f55dc0f2e76f903630f1d3d2941d5a.zip |
Added everything... -.-
Diffstat (limited to 'Renderer.h')
-rw-r--r-- | Renderer.h | 26 |
1 files changed, 18 insertions, 8 deletions
@@ -20,25 +20,35 @@ #ifndef ZOOM_RENDERER_H_ #define ZOOM_RENDERER_H_ -namespace Zoom { +#include "BSPTree.h" -class Triangle; -class BSPTree; +namespace Zoom { class Renderer { public: + Renderer() : lastTexture(0), renderVisitor(this) {} + void render(const BSPTree &tree); + void render(const std::list<BSPTree::TriangleRecord> &triangles); private: - static void renderTriangle(const Triangle &t); + void renderTriangle(const Triangle &t); - struct RenderVisitor { - void operator() (const Triangle &t) const { - renderTriangle(t); + class RenderVisitor { + public: + RenderVisitor(Renderer *renderer0) : renderer(renderer0) {} + + void operator() (const BSPTree::TriangleRecord &t) const { + renderer->renderTriangle(t.triangle); } + + private: + Renderer *renderer; }; - static const RenderVisitor renderVisitor; + unsigned lastTexture; + + const RenderVisitor renderVisitor; }; } |