zenilib: zenilib/jni/external/zenilib/zeni_graphics/Zeni/Triangle.h Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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);
44 Triangle<VERTEX> & operator=(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
61 Triangle<VERTEX> * get_duplicate() const;
62
63 Triangle<VERTEX> * get_duplicate_subt0() const;
64 Triangle<VERTEX> * get_duplicate_subt1() const;
65 Triangle<VERTEX> * get_duplicate_subt2() const;
66 Triangle<VERTEX> * get_duplicate_subt3() const;
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
Zeni::Video_DX9
The Direct3D9 Rendering System.
Definition: Video_DX9.h:62
Zeni::Triangle::a
VERTEX a
Definition: Triangle.h:72
Zeni::Triangle::get_duplicate_subt1
Triangle< VERTEX > * get_duplicate_subt1() const
Get quarter 1 of the Triangle; Can be used for software LOD increase.
Definition: Triangle.hxx:116
Zeni::Triangle::operator=
Triangle< VERTEX > & operator=(const Triangle< VERTEX > &rhs)
Definition: Triangle.hxx:68
Zeni::Renderable
A Renderable Interface.
Definition: Renderable.h:47
Zeni::Triangle::get_duplicate
Triangle< VERTEX > * get_duplicate() const
Get a duplicate of the Triangle.
Definition: Triangle.hxx:102
Renderable.h
Zeni::Triangle::get_duplicate_subt2
Triangle< VERTEX > * get_duplicate_subt2() const
Get quarter 2 of the Triangle; Can be used for software LOD increase.
Definition: Triangle.hxx:125
Zeni::Triangle::get_duplicate_subt3
Triangle< VERTEX > * get_duplicate_subt3() const
Get quarter 3 of the Triangle; Can be used for software LOD increase.
Definition: Triangle.hxx:134
Zeni::Triangle::get_duplicate_subt0
Triangle< VERTEX > * get_duplicate_subt0() const
Get quarter 0 of the Triangle; Can be used for software LOD increase.
Definition: Triangle.hxx:107
Zeni::Video_GL_Fixed
The OpenGL Rendering System.
Definition: Video_GL_Fixed.h:70
Zeni::Triangle::c
VERTEX c
Definition: Triangle.h:74
Zeni::Video_GL_Shader
The OpenGL Rendering System.
Definition: Video_GL_Shader.h:70
index
GLuint index
Definition: glew.h:1800
Zeni::Triangle::Triangle
Triangle()
Definition: Triangle.hxx:43
Zeni::Triangle::b
VERTEX b
Definition: Triangle.h:73
Zeni::Triangle::render_to
virtual void render_to(Video_GL_Fixed &screen) const
Overridden for OpenGL rendering.
Definition: Triangle.hxx:85
Zeni::Triangle::is_3d
virtual bool is_3d() const
Tell the rendering system if we&#39;re using 3D coordinates.
Definition: Triangle.hxx:79
Zeni::Triangle
An Abstraction of a Triangle.
Definition: Triangle.h:36
Zeni::Triangle::operator[]
const VERTEX & operator[](const int &index) const
Get &#39;index&#39;.
Definition: Triangle.hxx:144