zenilib: zenilib/jni/external/zenilib/zeni_graphics/Zeni/Video.hxx 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
Video.hxx
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_VIDEO_HXX
19 #define ZENI_VIDEO_HXX
20
21 // HXXed below
22 #include <Zeni/Camera.h>
23 #include <Zeni/Renderable.h>
24 #include <Zeni/Textures.h>
25 #include <Zeni/Quaternion.h>
26
27 #include <Zeni/Video.h>
28
29 #include <Zeni/Define.h>
30
31 namespace Zeni {
32
33 Video::VIDEO_MODE Video::get_video_mode() {
34 return g_video_mode;
35 }
36
37 bool Video::get_backface_culling() {
38 return g_backface_culling;
39 }
40
41 bool Video::get_lighting() {
42 return g_lighting;
43 }
44
45 const Color & Video::get_ambient_lighting() {
46 return g_ambient_lighting;
47 }
48
49 bool Video::get_normal_interpolation() {
50 return g_normal_interp;
51 }
52
53 bool Video::get_vertical_sync() {
54 return g_vertical_sync;
55 }
56
57 int Video::get_multisampling() {
58 return g_multisampling;
59 }
60
61 bool Video::is_zwrite_enabled() const {
62 return g_zwrite;
63 }
64
65 bool Video::is_ztest_enabled() const {
66 return g_ztest;
67 }
68
69 bool Video::is_alpha_test_enabled() const {
70 return m_alpha_test;
71 }
72
73 Video::TEST Video::get_alpha_test_function() const {
74 return m_alpha_function;
75 }
76
77 float Video::get_alpha_test_value() const {
78 return m_alpha_value;
79 }
80
81 bool Video::is_3d() const {
82 return m_3d;
83 }
84
85 ShHandle Video::get_vertex_shader_compiler() const {
86 return m_vertex_compiler;
87 }
88
89 ShHandle Video::get_fragment_shader_compiler() const {
90 return m_fragment_compiler;
91 }
92
93 void Video::set_2d() {
94 const Point2i &size = get_render_target_size();
95 set_2d_view(std::make_pair(Point2f(), Point2f(float(size.x), float(size.y))),
96 std::make_pair(Point2i(), size));
97 }
98
99 void Video::set_2d(const std::pair<Point2f, Point2f> &camera2d, const bool &fix_aspect_ratio) {
100 set_2d_view(camera2d,
101 std::make_pair(Point2i(), get_render_target_size()),
102 fix_aspect_ratio);
103 }
104
105 void Video::set_3d(const Camera &camera) {
106 set_3d_view(camera,
107 std::make_pair(Point2i(), get_render_target_size()));
108 }
109
110 const Color & Video::get_Color() const {
111 return m_color;
112 }
113
114 const Color & Video::get_clear_Color() const {
115 return g_clear_color;
116 }
117
118 void Video::apply_Texture(const String &name) {
119 apply_Texture(get_Textures().get_id(name));
120 }
121
122 void Video::rotate_scene(const Quaternion &rotation) {
123 const std::pair<Vector3f, float> rayngel = rotation.get_rotation();
124 rotate_scene(rayngel.first, rayngel.second);
125 }
126
127 const Matrix4f & Video::get_view_matrix() const {
128 return m_view;
129 }
130
131 const Matrix4f & Video::get_projection_matrix() const {
132 return m_projection;
133 }
134
135 const std::pair<Point2i, Point2i> & Video::get_viewport() const {
136 return m_viewport;
137 }
138
139 }
140
141 #include <Zeni/Undefine.h>
142
143 #include <Zeni/Camera.hxx>
144 #include <Zeni/Renderable.hxx>
145 #include <Zeni/Textures.hxx>
146 #include <Zeni/Quaternion.hxx>
147
148 #endif
Zeni::Point2i::y
Sint32 y
Definition: Coordinate.h:94
Quaternion.hxx
Zeni::Video::get_clear_Color
const Color & get_clear_Color() const
Get the blank background color.
Definition: Video.hxx:114
Zeni::Video::get_projection_matrix
const Matrix4f & get_projection_matrix() const
Get the projection Matrix4f.
Definition: Video.hxx:131
Zeni::Camera
Camera / Point of View.
Definition: Camera.h:49
Zeni::Video::get_viewport
const std::pair< Point2i, Point2i > & get_viewport() const
Get the viewport.
Definition: Video.hxx:135
ShHandle
void * ShHandle
Definition: ShaderLang.h:255
Textures.h
Zeni::Video::get_backface_culling
static bool get_backface_culling()
Determine whether backface culling is enabled.
Definition: Video.hxx:37
Zeni::Video::get_lighting
static bool get_lighting()
Determine whether dynamic lighting is enabled.
Definition: Video.hxx:41
Video.h
Zeni::Video::get_fragment_shader_compiler
ShHandle get_fragment_shader_compiler() const
Get the fragment shader compiler.
Definition: Video.hxx:89
Textures.hxx
Zeni::Video::VIDEO_MODE
VIDEO_MODE
Definition: Video.h:96
Zeni::Video::get_render_target_size
virtual const Point2i & get_render_target_size() const =0
Get the dimensions of the render target.
Renderable.hxx
name
EGLImageKHR EGLint * name
Definition: eglext.h:284
Zeni::Video::is_alpha_test_enabled
bool is_alpha_test_enabled() const
Determine whether alpha testing is enabled.
Definition: Video.hxx:69
Zeni::Video::get_alpha_test_function
TEST get_alpha_test_function() const
Determine which alpha test is in use.
Definition: Video.hxx:73
Undefine.h
Camera.hxx
Zeni::Video::m_vertex_compiler
ShHandle m_vertex_compiler
Definition: Video.h:243
Zeni::Video::is_3d
bool is_3d() const
Determine whether currently rendering in 3D.
Definition: Video.hxx:81
Zeni::Video::get_vertex_shader_compiler
ShHandle get_vertex_shader_compiler() const
Get the vertex shader compiler.
Definition: Video.hxx:85
Zeni::String
Definition: String.h:29
Renderable.h
Zeni::Video::is_zwrite_enabled
bool is_zwrite_enabled() const
Determine whether writing to Z-Buffer is enabled.
Definition: Video.hxx:61
Zeni::Video::get_normal_interpolation
static bool get_normal_interpolation()
Determine whether normal interpolation is enabled.
Definition: Video.hxx:49
Zeni::Video::apply_Texture
void apply_Texture(const String &name)
Apply a texture by name.
Definition: Video.hxx:118
Zeni::Video::get_view_matrix
const Matrix4f & get_view_matrix() const
Get the view Matrix4f.
Definition: Video.hxx:127
Zeni::Video::set_3d
void set_3d(const Camera &camera)
Set a 3D view filling the entire display area.
Definition: Video.hxx:105
Zeni::Quaternion::get_rotation
std::pair< Vector3f, float > get_rotation() const
Get the rotation in radians left about an axis.
Definition: Quaternion.hxx:182
Define.h
Zeni::Video::rotate_scene
virtual void rotate_scene(const Vector3f &about, const float &radians)=0
Rotate the scene.
Zeni::Video::get_ambient_lighting
static const Color & get_ambient_lighting()
Get the current ambient lighting Color.
Definition: Video.hxx:45
Zeni::Video::set_3d_view
virtual void set_3d_view(const Camera &camera, const std::pair< Point2i, Point2i > &viewport=std::make_pair(Point2i(), get().get_render_target_size()))=0
Set a 3D view for a viewport.
Definition: Video.cpp:174
Zeni::Video::set_2d
void set_2d()
Set the default 2D view filling the entire display area.
Definition: Video.hxx:93
Zeni::Quaternion
A Featureful Quaternion Class.
Definition: Quaternion.h:44
Quaternion.h
Zeni::Video::get_multisampling
static int get_multisampling()
Get the current level of multisampling.
Definition: Video.hxx:57
Zeni::Video::get_video_mode
static VIDEO_MODE get_video_mode()
Get the currently selected video mode.
Definition: Video.hxx:33
Zeni::Video::set_2d_view
virtual void set_2d_view(const std::pair< Point2f, Point2f > &camera2d, const std::pair< Point2i, Point2i > &viewport=std::make_pair(Point2i(), get().get_render_target_size()), const bool &fix_aspect_ratio=false)=0
Set a 2D view for a viewport.
Definition: Video.cpp:153
Zeni::get_Textures
Textures & get_Textures()
Get access to the singleton.
Definition: Textures.cpp:64
Zeni::Point2i::x
Sint32 x
Definition: Coordinate.h:94
Camera.h
Zeni::Video::get_vertical_sync
static bool get_vertical_sync()
Determine whether vertical sync is enabled.
Definition: Video.hxx:53
Zeni::Video::is_ztest_enabled
bool is_ztest_enabled() const
Determine whether testing the Z-Buffer is enabled.
Definition: Video.hxx:65
Zeni::Video::TEST
TEST
Definition: Video.h:98
Zeni::Video::get_Color
const Color & get_Color() const
Get the current color.
Definition: Video.hxx:110
Zeni::Matrix4f
A Featureful 4-Space Matrix Class.
Definition: Matrix4f.h:47
Zeni::Video::m_fragment_compiler
ShHandle m_fragment_compiler
Definition: Video.h:244
Zeni::Point2f
A 2D Point represented with floats.
Definition: Coordinate.h:98
Zeni::Color
Color.
Definition: Color.h:41
Zeni::Video::get_alpha_test_value
float get_alpha_test_value() const
Determine what value the alpha test is comparing against.
Definition: Video.hxx:77
size
GLsizei size
Definition: gl2ext.h:1467
Zeni::Point2i
A 2D Point represented with integers.
Definition: Coordinate.h:85