zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Quadrilateral.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_QUADRILATERAL_H
19 #define ZENI_QUADRILATERAL_H
20 
21 #include <Zeni/Renderable.h>
22 #include <Zeni/Triangle.h>
23 
24 namespace Zeni {
25 
36  template <typename VERTEX>
37  class Quadrilateral : public Renderable {
38  public:
39  Quadrilateral();
40  Quadrilateral(const VERTEX &vertex0,
41  const VERTEX &vertex1,
42  const VERTEX &vertex2,
43  const VERTEX &vertex3);
44 
47 
49  virtual bool is_3d() const;
50 
51 #ifndef DISABLE_GL_FIXED
52  virtual void render_to(Video_GL_Fixed &screen) const;
53 #endif
54 
55 #ifndef DISABLE_GL_SHADER
56  virtual void render_to(Video_GL_Shader &screen) const;
57 #endif
58 
59 #ifndef DISABLE_DX9
60  virtual void render_to(Video_DX9 &screen) const;
61 #endif
62 
64 
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  VERTEX d;
76 
77  private:
78  void * m_alignment_rubbish;
79  };
80 
81 }
82 
83 #endif
The Direct3D9 Rendering System.
Definition: Video_DX9.h:62
An Abstraction of a Quadrilateral.
Definition: Quadrilateral.h:37
A Renderable Interface.
Definition: Renderable.h:47
Triangle< VERTEX > * get_duplicate_t1() const
Get the second half of the Quadrilateral.
The OpenGL Rendering System.
virtual void render_to(Video_GL_Fixed &screen) const
Overridden for OpenGL rendering.
Quadrilateral< VERTEX > & operator=(const Quadrilateral< VERTEX > &rhs)
The OpenGL Rendering System.
Quadrilateral< VERTEX > * get_duplicate() const
Get a duplicate of the Quadrilateral.
GLuint index
Definition: glew.h:1800
virtual bool is_3d() const
Tell the rendering system if we&#39;re using 3D coordinates.
Triangle< VERTEX > * get_duplicate_t0() const
Get the first half of the Quadrilateral.
An Abstraction of a Triangle.
Definition: Triangle.h:36
const VERTEX & operator[](const int &index) const
Get &#39;index&#39;.