zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Triangle.h
Go to the documentation of this file.
1 /* This file is part of the Zenipex Library (zenilib).
2  * Copyright (C) 2011 Mitchell Keith Bloch (bazald).
3  *
4  * zenilib is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * zenilib is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with zenilib. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef ZENI_TRIANGLE_H
19 #define ZENI_TRIANGLE_H
20 
21 #include <Zeni/Renderable.h>
22 
23 namespace Zeni {
24 
35  template <typename VERTEX>
36  class Triangle : public Renderable {
37  public:
38  Triangle();
39  Triangle(const VERTEX &vertex0,
40  const VERTEX &vertex1,
41  const VERTEX &vertex2);
42 
43  Triangle(const Triangle<VERTEX> &rhs);
45 
47  virtual bool is_3d() const;
48 
49 #ifndef DISABLE_GL_FIXED
50  virtual void render_to(Video_GL_Fixed &screen) const;
51 #endif
52 
53 #ifndef DISABLE_GL_SHADER
54  virtual void render_to(Video_GL_Shader &screen) const;
55 #endif
56 
57 #ifndef DISABLE_DX9
58  virtual void render_to(Video_DX9 &screen) const;
59 #endif
60 
62 
67 
68  // Indexing
69  const VERTEX & operator[](const int &index) const;
70  VERTEX & operator[](const int &index);
71 
72  VERTEX a;
73  VERTEX b;
74  VERTEX c;
75 
76  private:
77  void * m_alignment_rubbish;
78  };
79 
80 }
81 
82 #endif
The Direct3D9 Rendering System.
Definition: Video_DX9.h:62
VERTEX a
Definition: Triangle.h:72
Triangle< VERTEX > * get_duplicate_subt1() const
Get quarter 1 of the Triangle; Can be used for software LOD increase.
Definition: Triangle.hxx:116
Triangle< VERTEX > & operator=(const Triangle< VERTEX > &rhs)
Definition: Triangle.hxx:68
A Renderable Interface.
Definition: Renderable.h:47
Triangle< VERTEX > * get_duplicate() const
Get a duplicate of the Triangle.
Definition: Triangle.hxx:102
Triangle< VERTEX > * get_duplicate_subt2() const
Get quarter 2 of the Triangle; Can be used for software LOD increase.
Definition: Triangle.hxx:125
Triangle< VERTEX > * get_duplicate_subt3() const
Get quarter 3 of the Triangle; Can be used for software LOD increase.
Definition: Triangle.hxx:134
Triangle< VERTEX > * get_duplicate_subt0() const
Get quarter 0 of the Triangle; Can be used for software LOD increase.
Definition: Triangle.hxx:107
The OpenGL Rendering System.
VERTEX c
Definition: Triangle.h:74
The OpenGL Rendering System.
GLuint index
Definition: glew.h:1800
VERTEX b
Definition: Triangle.h:73
virtual void render_to(Video_GL_Fixed &screen) const
Overridden for OpenGL rendering.
Definition: Triangle.hxx:85
virtual bool is_3d() const
Tell the rendering system if we&#39;re using 3D coordinates.
Definition: Triangle.hxx:79
An Abstraction of a Triangle.
Definition: Triangle.h:36
const VERTEX & operator[](const int &index) const
Get &#39;index&#39;.
Definition: Triangle.hxx:144