summaryrefslogtreecommitdiffstats
path: root/Renderer.h
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-12-14 13:54:34 +0100
committerMatthias Schiffer <matthias@gamezock.de>2009-12-14 13:54:34 +0100
commitff7b7c8838f55dc0f2e76f903630f1d3d2941d5a (patch)
tree2c2f053b84251c9216a851a26edac4bc17c607bb /Renderer.h
parentda66d49b8a7bcc808df201bee5c7cb787b6f30b7 (diff)
downloadzoom++-ff7b7c8838f55dc0f2e76f903630f1d3d2941d5a.tar
zoom++-ff7b7c8838f55dc0f2e76f903630f1d3d2941d5a.zip
Added everything... -.-
Diffstat (limited to 'Renderer.h')
-rw-r--r--Renderer.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/Renderer.h b/Renderer.h
index d64a4fe..d72b5bb 100644
--- a/Renderer.h
+++ b/Renderer.h
@@ -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;
};
}