From 1a321ed999334f0d9f5255249ebeeed0278871d6 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 10 Dec 2009 09:08:16 +0100 Subject: Benutzte BSPTrees zum rendern --- DisplayClass.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'DisplayClass.h') diff --git a/DisplayClass.h b/DisplayClass.h index d297ca4..0341469 100644 --- a/DisplayClass.h +++ b/DisplayClass.h @@ -1,8 +1,7 @@ #ifndef _DISPLAYCLASS_H_ #define _DISPLAYCLASS_H_ -#include "Cuboid.h" -#include "Cubehole.h" +#include "Trapezocube.h" class DisplayClass { @@ -12,11 +11,24 @@ class DisplayClass void renderScene(unsigned long delta); private: - struct RenderVisitor { - void operator() (const Triangle &t) const; + struct OpaqueRenderer { + void operator() (const Triangle &t) const { + if(t.getColor().a() == 1.0) + t.render(); + } }; - Cuboid cubes[5][5][5]; + struct TransparentRenderer { + void operator() (const Triangle &t) const { + if(t.getColor().a() != 1.0) + t.render(); + } + }; + + static OpaqueRenderer opaqueRenderer; + static TransparentRenderer transparentRenderer; + + Trapezocube cubeing[8]; }; #endif /*_DISPLAYCLASS_H_*/ -- cgit v1.2.3