63 class Vertex_Buffer_Renderer;
68 ZENI_GRAPHICS_EXT
template class ZENI_GRAPHICS_DLL Singleton<Video>;
74 static Video * create();
77 #pragma warning( push )
78 #pragma warning( disable : 4251 )
80 static Uninit g_uninit;
81 static Reinit g_reinit;
83 #pragma warning( pop )
96 enum VIDEO_MODE {ZENI_VIDEO_ANY, ZENI_VIDEO_GL_FIXED, ZENI_VIDEO_DX9, ZENI_VIDEO_GL_SHADER};
103 ZENI_LESS_OR_EQUAL = 3,
104 ZENI_GREATER_OR_EQUAL = 6,
108 virtual bool begin_prerender() = 0;
109 virtual bool begin_render() = 0;
110 virtual void end_render() = 0;
112 virtual void clear_depth_buffer() = 0;
115 inline static VIDEO_MODE get_video_mode();
116 inline static bool get_backface_culling();
117 inline static bool get_lighting();
118 inline static const Color & get_ambient_lighting();
119 inline static bool get_normal_interpolation();
120 inline static bool get_vertical_sync();
121 inline static int get_multisampling();
122 virtual int get_maximum_anisotropy()
const = 0;
123 virtual bool has_vertex_buffers()
const = 0;
124 inline bool is_zwrite_enabled()
const;
125 inline bool is_ztest_enabled()
const;
126 inline bool is_alpha_test_enabled()
const;
127 inline TEST get_alpha_test_function()
const;
128 inline float get_alpha_test_value()
const;
129 inline bool is_3d()
const;
130 inline ShHandle get_vertex_shader_compiler()
const;
131 inline ShHandle get_fragment_shader_compiler()
const;
134 inline void set_2d();
135 inline void set_2d(
const std::pair<Point2f, Point2f> &camera2d,
136 const bool &fix_aspect_ratio =
false);
137 inline void set_3d(
const Camera &camera);
138 virtual void set_2d_view(
const std::pair<Point2f, Point2f> &camera2d,
139 const std::pair<Point2i, Point2i> &viewport = std::make_pair(
Point2i(),
get().get_render_target_size()),
140 const bool &fix_aspect_ratio =
false) = 0;
141 virtual void set_3d_view(
const Camera &camera,
const std::pair<Point2i, Point2i> &viewport =
142 std::make_pair(
Point2i(),
get().get_render_target_size())) = 0;
143 virtual void set_backface_culling(
const bool &on) = 0;
144 virtual void set_vertical_sync(
const bool &on) = 0;
145 virtual void set_zwrite(
const bool &
enabled) = 0;
146 virtual void set_ztest(
const bool &
enabled) = 0;
147 virtual void set_alpha_test(
const bool &
enabled,
const TEST &test = ZENI_ALWAYS,
const float &
value = 0.0
f) = 0;
150 inline const Color & get_Color()
const;
151 inline const Color & get_clear_Color()
const;
152 virtual void set_Color(
const Color &
color) = 0;
153 virtual void set_clear_Color(
const Color &
color) = 0;
154 inline void apply_Texture(
const String &
name);
155 virtual void apply_Texture(
const unsigned long &
id) = 0;
157 virtual void unapply_Texture() = 0;
160 virtual void set_lighting(
const bool &on =
true) = 0;
161 virtual void set_ambient_lighting(
const Color &
color) = 0;
162 const Light * get_Light(
const int &number)
const;
163 virtual void set_Light(
const int &number,
const Light &
light) = 0;
164 virtual void unset_Light(
const int &number) = 0;
165 virtual void set_Material(
const Material &material) = 0;
166 virtual void unset_Material(
const Material &material) = 0;
169 const Fog * get_Fog()
const;
170 virtual void set_Fog(
const Fog &fog) = 0;
171 virtual void unset_Fog() = 0;
175 virtual void unset_program() = 0;
179 virtual void unset_render_target() = 0;
181 virtual const Point2i & get_render_target_size()
const = 0;
184 virtual void select_world_matrix() = 0;
185 virtual void push_world_stack() = 0;
186 virtual void pop_world_stack() = 0;
187 virtual void translate_scene(
const Vector3f &direction) = 0;
188 virtual void rotate_scene(
const Vector3f &about,
const float &radians) = 0;
189 inline void rotate_scene(
const Quaternion &rotation);
190 virtual void scale_scene(
const Vector3f &factor) = 0;
191 virtual void transform_scene(
const Matrix4f &transformation) = 0;
194 virtual Point2f get_pixel_offset()
const = 0;
195 inline const Matrix4f & get_view_matrix()
const;
196 inline const Matrix4f & get_projection_matrix()
const;
197 inline const std::pair<Point2i, Point2i> & get_viewport()
const;
198 virtual void set_view_matrix(
const Matrix4f &view) = 0;
199 virtual void set_projection_matrix(
const Matrix4f &projection) = 0;
200 virtual void set_viewport(
const std::pair<Point2i, Point2i> &viewport =
201 std::make_pair(
Point2i(),
get().get_render_target_size())) = 0;
202 void set_viewport(
const float &aspect_ratio,
203 const std::pair<Point2i, Point2i> &viewport =
204 std::make_pair(
Point2i(),
get().get_render_target_size()));
205 std::pair<Point2i, Point2i> calculate_viewport(
const std::pair<Point2f, Point2f> &camera2d,
206 const std::pair<Point2i, Point2i> &viewport,
207 const bool &fix_aspect_ratio);
208 std::pair<Point2i, Point2i> calculate_viewport(
const float &aspect_ratio,
209 const std::pair<Point2i, Point2i> &viewport =
210 std::make_pair(
Point2i(),
get().get_render_target_size()))
const;
213 virtual Texture * load_Texture(
const String &
filename,
const bool &repeat,
const bool &lazy_loading =
false) = 0;
217 const float &glyph_height,
const float &virtual_screen_height) = 0;
221 virtual Program * create_Program() = 0;
224 static void preinit_video_mode(
const VIDEO_MODE &vm = ZENI_VIDEO_ANY);
225 static void preinit_multisampling(
const int &multisampling = 0);
226 static void preinit_vertical_sync(
const bool &vertical_sync =
false);
231 static void change_resolution(
const Point2i &resolution);
233 static void save(
const bool &backup =
true);
234 static bool revert();
235 static void set_failsafe_defaults();
249 static bool g_backface_culling;
250 static bool g_lighting;
251 static Color g_ambient_lighting;
253 #pragma warning( push )
254 #pragma warning( disable : 4251 )
259 #pragma warning( pop )
261 static bool g_fog_enabled;
262 static Color g_clear_color;
263 static bool g_normal_interp;
264 static bool g_vertical_sync;
265 static int g_multisampling;
273 #pragma warning( push )
274 #pragma warning( disable : 4251 )
276 std::pair<Point2i, Point2i> m_viewport;
278 #pragma warning( pop )
281 static bool g_zwrite;
285 TEST m_alpha_function;
An Abstraction of a Light.
const GLubyte GLuint GLuint GLuint GLuint alpha GLboolean GLboolean GLboolean GLboolean alpha GLint GLint GLsizei GLsizei GLenum type GLenum GLint GLenum GLint GLint GLsizei GLsizei GLint border GLenum GLint GLint GLint GLint GLint GLsizei GLsizei height GLsizei GLsizei GLenum GLenum const GLvoid *pixels GLenum GLint GLint GLint GLint j2 GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble zFar GLenum light
The Video Rendering Singleton.
GLenum GLsizei const GLuint GLboolean enabled
static void render(const Vertex_Buffer_Macrorenderer ¯orenderer, std::vector< Vertex_Buffer::Vertex_Buffer_Range * > &descriptors)
An Abstraction of a Material.
EGLImageKHR EGLint * name
ShHandle m_vertex_compiler
An Abstraction of a Texture.
A Featureful 3-Space Vector Class.
A Featureful Quaternion Class.
GLSL_ES_Shader_Compilation_Failure()
Video_Render_To_Texture_Error()
A class to open an XML file and manage the root node.
GLbitfield GLuint program
A Vertex_Buffer that accepts Triangle and Quadrilaterals.
GLenum GLenum GLuint texture
EGLSurface EGLint void ** value
A base class for Vertex_Shader and Fragment_Shader.
static void print_errors()
Video & get_Video()
Get access to the singleton.
A Featureful 4-Space Matrix Class.
ShHandle m_fragment_compiler
A 2D Point represented with floats.
A 2D Point represented with integers.