summaryrefslogtreecommitdiffstats
path: root/DisplayClass.h
blob: 0341469324223237d66eb068d99b9efa0e3e69ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef _DISPLAYCLASS_H_
#define _DISPLAYCLASS_H_

#include "Trapezocube.h"

class DisplayClass
{
  public:
    DisplayClass();

    void renderScene(unsigned long delta);

  private:
    struct OpaqueRenderer {
      void operator() (const Triangle &t) const {
        if(t.getColor().a() == 1.0)
          t.render();
      }
    };

    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_*/