zenilib: zenilib/jni/external/zenilib/zeni_graphics/Zeni/Vertex3f.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
Vertex3f.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
42 #ifndef ZENI_VERTEX3F_H
43 #define ZENI_VERTEX3F_H
44
45 #include <Zeni/Color.h>
46 #include <Zeni/Coordinate.h>
47 #include <Zeni/Line_Segment.h>
48 #include <Zeni/Quadrilateral.h>
49 #include <Zeni/Renderable.h>
50 #include <Zeni/String.h>
51 #include <Zeni/Triangle.h>
52 #include <Zeni/Vector3f.h>
53
54 namespace Zeni {
55
56 class ZENI_GRAPHICS_DLL Vertex3f {
57 protected:
58 Vertex3f();
59 Vertex3f(const Point3f &position, const Point3f &normal = Point3f());
60 public:
61 virtual ~Vertex3f();
62
63 virtual Point3f get_position() const;
64
65 inline void * get_address() const;
66 #if defined(_WINDOWS) && defined(X64)
67 inline unsigned long long get_offset() const;
68 #else
69 inline unsigned long get_offset() const;
70 #endif
71
72 Point3f position;
73 Point3f normal;
74 };
75
76 class ZENI_GRAPHICS_DLL Vertex3f_Color : public Renderable, public Vertex3f {
77 public:
79 Vertex3f_Color();
80 Vertex3f_Color(const Point3f &position, const Point3f &normal, const Color &color);
81 Vertex3f_Color(const Point3f &position, const Point3f &normal, const Uint32 &argb);
82 Vertex3f_Color(const Point3f &position, const Color &color);
83 Vertex3f_Color(const Point3f &position, const Uint32 &argb);
84
85 Vertex3f_Color * interpolate_to(const float &rhs_part, const Vertex3f_Color &rhs) const;
86
87 inline const Uint32 & get_Color() const;
88 inline void set_Color(const Color &color);
89 inline void set_Color(const Uint32 &argb);
90
91 // Begin rendering functions
92
93 virtual bool is_3d() const;
94
95 #ifndef DISABLE_GL_FIXED
96 virtual void render_to(Video_GL_Fixed &screen) const;
97 virtual void subrender_to(Video_GL_Fixed &screen) const;
98 #endif
99
100 #ifndef DISABLE_GL_Shader
101 virtual void render_to(Video_GL_Shader &screen) const;
102 virtual void subrender_to(Video_GL_Shader &screen) const;
103 #endif
104
105 #ifndef DISABLE_DX9
106 virtual void render_to(Video_DX9 &screen) const;
107 #endif
108
109 private:
110 Uint32 m_argb;
111 };
112
113 class ZENI_GRAPHICS_DLL Vertex3f_Texture : public Renderable, public Vertex3f {
114 public:
116 Vertex3f_Texture();
117 Vertex3f_Texture(const Point3f &position, const Point3f &normal, const Point2f &texture_coordinate);
118 Vertex3f_Texture(const Point3f &position, const Point2f &texture_coordinate);
119
120 Vertex3f_Texture * interpolate_to(const float &rhs_part, const Vertex3f_Texture &rhs) const;
121
122 // Begin rendering functions
123
124 virtual bool is_3d() const;
125
126 // NOTE: Not really meaningful to render a textured point in isolation;
127 // assert(false) for all but subrender_to(Video_GL &)
128
129 #ifndef DISABLE_GL_FIXED
130 virtual void render_to(Video_GL_Fixed &screen) const;
131 virtual void subrender_to(Video_GL_Fixed &screen) const;
132 #endif
133
134 #ifndef DISABLE_GL_Shader
135 virtual void render_to(Video_GL_Shader &screen) const;
136 virtual void subrender_to(Video_GL_Shader &screen) const;
137 #endif
138
139 #ifndef DISABLE_DX9
140 virtual void render_to(Video_DX9 &screen) const;
141 #endif
142
143 Point2f texture_coordinate;
144 };
145
146 #ifdef _WINDOWS
147 ZENI_GRAPHICS_EXT template class ZENI_GRAPHICS_DLL Line_Segment<Vertex3f_Color>;
148 ZENI_GRAPHICS_EXT template class ZENI_GRAPHICS_DLL Line_Segment<Vertex3f_Texture>;
149 ZENI_GRAPHICS_EXT template class ZENI_GRAPHICS_DLL Quadrilateral<Vertex3f_Color>;
150 ZENI_GRAPHICS_EXT template class ZENI_GRAPHICS_DLL Quadrilateral<Vertex3f_Texture>;
151 ZENI_GRAPHICS_EXT template class ZENI_GRAPHICS_DLL Triangle<Vertex3f_Color>;
152 ZENI_GRAPHICS_EXT template class ZENI_GRAPHICS_DLL Triangle<Vertex3f_Texture>;
153 #endif
154
155 }
156
157 #endif
Zeni::Vertex3f
Definition: Vertex3f.h:56
Zeni::Video_DX9
The Direct3D9 Rendering System.
Definition: Video_DX9.h:62
color
GLuint color
Definition: glew.h:7185
Zeni::Line_Segment
An Abstraction of a Line.
Definition: Line_Segment.h:36
Zeni::Vertex3f_Color
An Abstraction of a Vertex in 3-space, colored.
Definition: Vertex3f.h:76
Zeni::Quadrilateral
An Abstraction of a Quadrilateral.
Definition: Quadrilateral.h:37
Zeni::Vertex3f_Texture
An Abstraction of a Vertex in 3-space, textured.
Definition: Vertex3f.h:113
Zeni::Renderable
A Renderable Interface.
Definition: Renderable.h:47
Zeni::Vertex3f::position
Point3f position
Definition: Vertex3f.h:72
Zeni::Vertex3f_Texture::texture_coordinate
Point2f texture_coordinate
Definition: Vertex3f.h:143
Renderable.h
Zeni::Point3f
A 3D Point represented with floats.
Definition: Coordinate.h:133
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:145
Coordinate.h
Vector3f.h
Zeni::Video_GL_Fixed
The OpenGL Rendering System.
Definition: Video_GL_Fixed.h:70
Quadrilateral.h
Triangle.h
Zeni::Video_GL_Shader
The OpenGL Rendering System.
Definition: Video_GL_Shader.h:70
String.h
Zeni::Triangle
An Abstraction of a Triangle.
Definition: Triangle.h:36
Color.h
Zeni::Vertex3f::normal
Point3f normal
Definition: Vertex3f.h:73
Zeni::Point2f
A 2D Point represented with floats.
Definition: Coordinate.h:98
Zeni::Color
Color.
Definition: Color.h:41
Line_Segment.h