zenilib
0.5.3.0
|
The Video Rendering Singleton. More...
#include <Video.h>
Inherits Zeni::Singleton< Video >.
Inherited by Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Public Types | |
enum | TEST { ZENI_NEVER = 0, ZENI_LESS = 1, ZENI_EQUAL = 2, ZENI_GREATER = 4, ZENI_NOT_EQUAL = 8, ZENI_LESS_OR_EQUAL = 3, ZENI_GREATER_OR_EQUAL = 6, ZENI_ALWAYS = 15 } |
enum | VIDEO_MODE { ZENI_VIDEO_ANY, ZENI_VIDEO_GL_FIXED, ZENI_VIDEO_DX9, ZENI_VIDEO_GL_SHADER } |
Public Member Functions | |
void | apply_Texture (const String &name) |
Apply a texture by name. More... | |
virtual void | apply_Texture (const unsigned long &id)=0 |
Apply a texture by id. More... | |
virtual void | apply_Texture (const Texture &texture)=0 |
Apply a texture by id. More... | |
virtual bool | begin_prerender ()=0 |
Must be called before begin_render. More... | |
virtual bool | begin_render ()=0 |
Must be called before all rendering functions; Returns true if rendering can proceed. More... | |
std::pair< Point2i, Point2i > | calculate_viewport (const std::pair< Point2f, Point2f > &camera2d, const std::pair< Point2i, Point2i > &viewport, const bool &fix_aspect_ratio) |
Calculate the viewport. More... | |
std::pair< Point2i, Point2i > | calculate_viewport (const float &aspect_ratio, const std::pair< Point2i, Point2i > &viewport=std::make_pair(Point2i(), get().get_render_target_size())) const |
Calculate the viewport. More... | |
virtual void | clear_depth_buffer ()=0 |
Can reset the depth buffer at any time if necessary. More... | |
virtual void | clear_render_target (const Color &color=Color(0.0f, 0.0f, 0.0f, 0.0f))=0 |
Clear the viewport. More... | |
virtual Font * | create_Font (const String &filename, const float &glyph_height, const float &virtual_screen_height)=0 |
Function for creating a Font; used internally by Fonts. More... | |
virtual Shader * | create_Fragment_Shader (const String &filename)=0 |
Create a Fragment_Shader from a file. More... | |
virtual Program * | create_Program ()=0 |
Create a Program from a file. More... | |
virtual Texture * | create_Texture (const Image &image)=0 |
Function for creating a Texture from an Image. More... | |
virtual Texture * | create_Texture (const Point2i &size, const bool &repeat)=0 |
Function for creating a Texture for render-to-texture. More... | |
virtual Vertex_Buffer_Renderer * | create_Vertex_Buffer_Renderer (Vertex_Buffer &vertex_buffer)=0 |
Function for creating a Vertex_Buffer_Renderer. More... | |
virtual Shader * | create_Vertex_Shader (const String &filename)=0 |
Create a Vertex_Shader from a file. More... | |
virtual void | end_render ()=0 |
Must be called after all rendering functions. More... | |
TEST | get_alpha_test_function () const |
Determine which alpha test is in use. More... | |
float | get_alpha_test_value () const |
Determine what value the alpha test is comparing against. More... | |
const Color & | get_clear_Color () const |
Get the blank background color. More... | |
const Color & | get_Color () const |
Get the current color. More... | |
const Fog * | get_Fog () const |
Get pointer to current Fog, or 0 if no Fog. More... | |
ShHandle | get_fragment_shader_compiler () const |
Get the fragment shader compiler. More... | |
const Light * | get_Light (const int &number) const |
Get pointer to Light, or 0 if no such Light. More... | |
virtual int | get_maximum_anisotropy () const =0 |
Get the current level of anisotrophy. More... | |
virtual Point2f | get_pixel_offset () const =0 |
Get the pixel offset in the 2d view. More... | |
const Matrix4f & | get_projection_matrix () const |
Get the projection Matrix4f. More... | |
virtual const Point2i & | get_render_target_size () const =0 |
Get the dimensions of the render target. More... | |
ShHandle | get_vertex_shader_compiler () const |
Get the vertex shader compiler. More... | |
const Matrix4f & | get_view_matrix () const |
Get the view Matrix4f. More... | |
const std::pair< Point2i, Point2i > & | get_viewport () const |
Get the viewport. More... | |
virtual bool | has_vertex_buffers () const =0 |
Determine whether Vertex_Buffers are supported. More... | |
bool | is_3d () const |
Determine whether currently rendering in 3D. More... | |
bool | is_alpha_test_enabled () const |
Determine whether alpha testing is enabled. More... | |
bool | is_ztest_enabled () const |
Determine whether testing the Z-Buffer is enabled. More... | |
bool | is_zwrite_enabled () const |
Determine whether writing to Z-Buffer is enabled. More... | |
virtual Texture * | load_Texture (const String &filename, const bool &repeat, const bool &lazy_loading=false)=0 |
Function for loading a Texture; used internally by Textures. More... | |
virtual void | pop_world_stack ()=0 |
Pop a model view matrix off the stack. More... | |
virtual void | push_world_stack ()=0 |
Push a model view matrix onto the stack. More... | |
virtual void | render (const Renderable &renderable)=0 |
Render a Renderable. More... | |
virtual void | rotate_scene (const Vector3f &about, const float &radians)=0 |
Rotate the scene. More... | |
void | rotate_scene (const Quaternion &rotation) |
Rotate the scene. More... | |
virtual void | scale_scene (const Vector3f &factor)=0 |
Scale the scene. More... | |
virtual void | select_world_matrix ()=0 |
Select the world (model view) matrix; Call before [translate/rotate/scale] scene. More... | |
void | set_2d () |
Set the default 2D view filling the entire display area. More... | |
void | set_2d (const std::pair< Point2f, Point2f > &camera2d, const bool &fix_aspect_ratio=false) |
Set a 2D view for the entire viewing area. More... | |
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. More... | |
void | set_3d (const Camera &camera) |
Set a 3D view filling the entire display area. More... | |
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. More... | |
virtual void | set_alpha_test (const bool &enabled, const TEST &test=ZENI_ALWAYS, const float &value=0.0f)=0 |
Set the alpha test. More... | |
virtual void | set_ambient_lighting (const Color &color)=0 |
Set ambient lighting on/off. More... | |
virtual void | set_backface_culling (const bool &on)=0 |
Set backface culling on/off. More... | |
virtual void | set_clear_Color (const Color &color)=0 |
Set the blank background color. More... | |
virtual void | set_Color (const Color &color)=0 |
Set the current color. More... | |
virtual void | set_Fog (const Fog &fog)=0 |
Set Fog. More... | |
virtual void | set_Light (const int &number, const Light &light)=0 |
Set a particular Light. More... | |
virtual void | set_lighting (const bool &on=true)=0 |
Set lighting on/off. More... | |
virtual void | set_Material (const Material &material)=0 |
Set a Material. More... | |
virtual void | set_program (Program &program)=0 |
Enable a program. More... | |
virtual void | set_projection_matrix (const Matrix4f &projection)=0 |
Set the projection Matrix4f. More... | |
virtual void | set_render_target (Texture &texture)=0 |
Set a render target. More... | |
virtual void | set_vertical_sync (const bool &on)=0 |
Set vertical_sync on/off. More... | |
virtual void | set_view_matrix (const Matrix4f &view)=0 |
Set the view Matrix4f. More... | |
virtual void | set_viewport (const std::pair< Point2i, Point2i > &viewport=std::make_pair(Point2i(), get().get_render_target_size()))=0 |
Set the viewport. More... | |
void | set_viewport (const float &aspect_ratio, const std::pair< Point2i, Point2i > &viewport=std::make_pair(Point2i(), get().get_render_target_size())) |
Set the viewport. More... | |
virtual void | set_ztest (const bool &enabled)=0 |
Enable or disable testing of the Z-Buffer. More... | |
virtual void | set_zwrite (const bool &enabled)=0 |
Enable or disable writing to the Z-Buffer. More... | |
virtual void | transform_scene (const Matrix4f &transformation)=0 |
Transform the scene. More... | |
virtual void | translate_scene (const Vector3f &direction)=0 |
Translate the scene. More... | |
virtual void | unapply_Texture ()=0 |
Unapply a texture. More... | |
virtual void | unset_Fog ()=0 |
Unset Fog. More... | |
virtual void | unset_Light (const int &number)=0 |
Unset a particular Light. More... | |
virtual void | unset_Material (const Material &material)=0 |
Unset a Material. More... | |
virtual void | unset_program ()=0 |
Disable a program. More... | |
virtual void | unset_render_target ()=0 |
Unset a render target. More... | |
![]() | |
void | fax_post_reinit (Event::Handler *const &handler) |
void | fax_pre_uninit (Event::Handler *const &handler) |
void | give_post_reinit (Event::Handler *const &handler) |
void | give_pre_uninit (Event::Handler *const &handler) |
void | lend_post_reinit (Event::Handler *const &handler) |
void | lend_pre_uninit (Event::Handler *const &handler) |
Static Public Member Functions | |
static void | change_resolution (const Point2i &resolution) |
static const Color & | get_ambient_lighting () |
Get the current ambient lighting Color. More... | |
static bool | get_backface_culling () |
Determine whether backface culling is enabled. More... | |
static bool | get_lighting () |
Determine whether dynamic lighting is enabled. More... | |
static int | get_multisampling () |
Get the current level of multisampling. More... | |
static bool | get_normal_interpolation () |
Determine whether normal interpolation is enabled. More... | |
static bool | get_vertical_sync () |
Determine whether vertical sync is enabled. More... | |
static VIDEO_MODE | get_video_mode () |
Get the currently selected video mode. More... | |
static void | preinit_from_file (const String &filename) |
Set rendering options from a file. More... | |
static void | preinit_from_file (const XML_Document &file) |
Set rendering options from a file. More... | |
static void | preinit_multisampling (const int &multisampling=0) |
Set a multisampling value. More... | |
static void | preinit_vertical_sync (const bool &vertical_sync=false) |
Set vertical_sync to true. More... | |
static void | preinit_video_mode (const VIDEO_MODE &vm=ZENI_VIDEO_ANY) |
Set which rendering engine to use. More... | |
static void | print_errors () |
Print any errors that may have occurred. More... | |
static bool | revert () |
Restore previously saved options; Returns true if successful. More... | |
static void | save (const bool &backup=true) |
Save options. More... | |
static void | set_failsafe_defaults () |
Set failsafe default options. More... | |
![]() | |
static void | completely_destroy () |
static void | destroy () |
static Video & | get () |
static bool | is_initialized () |
static void | remove_post_reinit (Event::Handler *const &handler) |
static void | remove_pre_uninit (Event::Handler *const &handler) |
Protected Member Functions | |
Video () | |
virtual | ~Video ()=0 |
String | compile_glsles_shader (const String &filename, const ShHandle &compiler) |
Compile an OpenGL ES shader to GLSL/HLSL. More... | |
![]() | |
Singleton () | |
virtual | ~Singleton () |
Protected Attributes | |
ShHandle | m_fragment_compiler |
ShHandle | m_vertex_compiler |
Friends | |
class | Singleton< Video > |
The Video Rendering Singleton.
Not literally related to video, as in movies, this base class supports graphics rendering. If you do not intend to write your own Renderables, this might be all you need. If you do intend to write your own Renderables, expect to use the derived Video classes as well.
Contact: bazal d@ze nipex .com
enum Zeni::Video::TEST |
|
protected |
Definition at line 119 of file Video.cpp.
References Zeni::get_Window(), Zeni::Singleton< TYPE >::lend_post_reinit(), Zeni::Singleton< TYPE >::lend_pre_uninit(), Zeni::Singleton< Window >::remove_post_reinit(), ShFinalize(), and ShInitialize().
|
protectedpure virtual |
Definition at line 145 of file Video.cpp.
References Zeni::Singleton< Window >::remove_pre_uninit().
Apply a texture by name.
Definition at line 118 of file Video.hxx.
References Zeni::get_Textures().
Referenced by Zeni::Video_GL_Fixed::apply_Texture(), Zeni::Video_GL_Shader::apply_Texture(), Zeni::Video_DX9::apply_Texture(), and Zeni::Font_FT::render_text().
Apply a texture by id.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Apply a texture by id.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
|
pure virtual |
Must be called before begin_render.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Referenced by engine_draw_frame(), and Zeni::Game::run().
|
pure virtual |
Must be called before all rendering functions; Returns true if rendering can proceed.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Referenced by engine_draw_frame(), and Zeni::Game::run().
std::pair< Point2i, Point2i > Zeni::Video::calculate_viewport | ( | const std::pair< Point2f, Point2f > & | camera2d, |
const std::pair< Point2i, Point2i > & | viewport, | ||
const bool & | fix_aspect_ratio | ||
) |
Calculate the viewport.
Definition at line 242 of file Video.cpp.
Referenced by Zeni::Widget_Gamestate::perform_logic(), set_2d_view(), and set_viewport().
Definition at line 366 of file Video.cpp.
References Zeni::Window::alert_window_resized(), Zeni::Singleton< Video >::destroy(), Zeni::get_File_Ops(), Zeni::Window::get_height(), Zeni::Window::get_width(), Zeni::get_Window(), preinit_from_file(), Zeni::Point2i::x, and Zeni::Point2i::y.
Referenced by Zeni::Gamestate_Base::on_video_resize().
|
pure virtual |
Can reset the depth buffer at any time if necessary.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Referenced by Zeni::Popup_State::render().
|
pure virtual |
Clear the viewport.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
|
protected |
Compile an OpenGL ES shader to GLSL/HLSL.
Definition at line 304 of file Video.cpp.
References Zeni::String::c_str(), SH_OBJECT_CODE, SH_OBJECT_CODE_LENGTH, SH_VALIDATE, ShCompile(), ShGetInfo(), and ShGetObjectCode().
Referenced by Zeni::Video_GL_Shader::create_Fragment_Shader(), Zeni::Video_DX9::create_Fragment_Shader(), Zeni::Video_GL_Shader::create_Vertex_Shader(), and Zeni::Video_DX9::create_Vertex_Shader().
|
pure virtual |
Function for creating a Font; used internally by Fonts.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Create a Fragment_Shader from a file.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
|
pure virtual |
Create a Program from a file.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Function for creating a Texture from an Image.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
|
pure virtual |
Function for creating a Texture for render-to-texture.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
|
pure virtual |
Function for creating a Vertex_Buffer_Renderer.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Referenced by Zeni::Vertex_Buffer::render().
Create a Vertex_Shader from a file.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
|
pure virtual |
Must be called after all rendering functions.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Referenced by engine_draw_frame(), and Zeni::Game::run().
|
inline |
Determine which alpha test is in use.
Definition at line 73 of file Video.hxx.
Referenced by Zeni::Video_GL_Shader::init(), and Zeni::Video_DX9::init_context().
|
inline |
Determine what value the alpha test is comparing against.
Definition at line 77 of file Video.hxx.
Referenced by Zeni::Video_GL_Shader::init(), and Zeni::Video_DX9::init_context().
Get the current ambient lighting Color.
Definition at line 45 of file Video.hxx.
Referenced by Zeni::Video_GL_Shader::init(), and Zeni::Video_DX9::init_context().
|
inlinestatic |
Determine whether backface culling is enabled.
Definition at line 37 of file Video.hxx.
Referenced by Zeni::Video_GL_Shader::init(), Zeni::Video_DX9::init_context(), Zeni::Video_GL_Shader::set_2d_view(), and Zeni::Video_GL_Shader::set_3d_view().
Get the blank background color.
Definition at line 114 of file Video.hxx.
Referenced by Zeni::Video_GL_Shader::begin_render(), Zeni::Video_DX9::begin_render(), Zeni::Video_GL_Shader::init(), Zeni::Video_DX9::init_context(), and Zeni::Widget_Gamestate::on_push().
Get the current color.
Definition at line 110 of file Video.hxx.
Referenced by Zeni::Video_GL_Shader::init(), Zeni::Video_DX9::init_context(), and Zeni::Font_FT::render_text().
Get pointer to current Fog, or 0 if no Fog.
Definition at line 291 of file Video.cpp.
Referenced by Zeni::Video_GL_Shader::init(), and Zeni::Video_DX9::init_context().
|
inline |
Get the fragment shader compiler.
Definition at line 89 of file Video.hxx.
References m_fragment_compiler.
Get pointer to Light, or 0 if no such Light.
Definition at line 274 of file Video.cpp.
Referenced by Zeni::Video_GL_Shader::init(), and Zeni::Video_DX9::init_context().
|
inlinestatic |
Determine whether dynamic lighting is enabled.
Definition at line 41 of file Video.hxx.
Referenced by Zeni::Texture_DX9::apply_Texture(), Zeni::Video_GL_Shader::init(), Zeni::Video_DX9::init_context(), and Zeni::Material::set().
|
pure virtual |
Get the current level of anisotrophy.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Referenced by Zeni::Textures::set_texturing_mode().
|
inlinestatic |
Get the current level of multisampling.
Definition at line 57 of file Video.hxx.
Referenced by Zeni::Video_GL_Shader::init(), Zeni::Video_DX9::init(), and Zeni::Video_DX9::init_context().
|
inlinestatic |
|
pure virtual |
Get the pixel offset in the 2d view.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Referenced by set_2d_view().
Get the dimensions of the render target.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
|
inline |
Get the vertex shader compiler.
Definition at line 85 of file Video.hxx.
References m_vertex_compiler.
|
inlinestatic |
Determine whether vertical sync is enabled.
Definition at line 53 of file Video.hxx.
Referenced by Zeni::Video_GL_Shader::end_render(), Zeni::Video_GL_Shader::init(), Zeni::Video_DX9::init(), and Zeni::Window::Window().
|
inlinestatic |
|
pure virtual |
Determine whether Vertex_Buffers are supported.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
|
inline |
Determine whether currently rendering in 3D.
Definition at line 81 of file Video.hxx.
Referenced by Zeni::Video_DX9::set_fvf(), and Zeni::Video_GL_Shader::set_projection_matrix().
|
inline |
Determine whether alpha testing is enabled.
Definition at line 69 of file Video.hxx.
Referenced by Zeni::Video_GL_Shader::init(), and Zeni::Video_DX9::init_context().
|
inline |
Determine whether testing the Z-Buffer is enabled.
Definition at line 65 of file Video.hxx.
Referenced by Zeni::Video_GL_Shader::init(), and Zeni::Video_DX9::init_context().
|
inline |
Determine whether writing to Z-Buffer is enabled.
Definition at line 61 of file Video.hxx.
Referenced by Zeni::Video_GL_Shader::begin_render(), Zeni::Video_GL_Shader::clear_depth_buffer(), Zeni::Video_GL_Shader::init(), and Zeni::Video_DX9::init_context().
|
pure virtual |
Function for loading a Texture; used internally by Textures.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
|
pure virtual |
Pop a model view matrix off the stack.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Referenced by Zeni::Model::render(), Zeni::Widget::render(), and Zeni::Selector::render_impl().
Set rendering options from a file.
Definition at line 336 of file Video.cpp.
References file.
Referenced by change_resolution(), and revert().
|
static |
Set rendering options from a file.
Definition at line 341 of file Video.cpp.
References Zeni::Window::preinit_from_xml(), preinit_multisampling(), preinit_vertical_sync(), preinit_video_mode(), Zeni::XML_Element_c::to_string(), ZENI_VIDEO_ANY, ZENI_VIDEO_DX9, ZENI_VIDEO_GL_FIXED, and ZENI_VIDEO_GL_SHADER.
Set a multisampling value.
Definition at line 328 of file Video.cpp.
Referenced by Zeni::Video_DX9::init_device(), load_config(), and preinit_from_file().
Set vertical_sync to true.
Definition at line 332 of file Video.cpp.
Referenced by load_config(), and preinit_from_file().
|
static |
Set which rendering engine to use.
Definition at line 324 of file Video.cpp.
Referenced by load_config(), and preinit_from_file().
|
static |
Print any errors that may have occurred.
Definition at line 529 of file Video.cpp.
References glGetError, and Zeni::gluErrorString().
Referenced by print_errors().
|
pure virtual |
Push a model view matrix onto the stack.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Referenced by Zeni::Model::render(), Zeni::Widget::render(), and Zeni::Selector::render_impl().
|
pure virtual |
Render a Renderable.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Referenced by Zeni::Vertex_Buffer::debug_render(), Zeni::Popup_State::render(), Zeni::render_image(), Zeni::Popup_Menu_State::Sound_Check_Box::render_impl(), Zeni::Text_Box::render_impl(), Zeni::Widget_Renderer_Color::render_to(), Zeni::Widget_Renderer_Texture::render_to(), Zeni::Widget_Renderer_Check_Box::render_to(), and Zeni::Widget_Renderer_Slider::render_to().
|
static |
Restore previously saved options; Returns true if successful.
Definition at line 457 of file Video.cpp.
References Zeni::File_Ops::copy_file(), Zeni::File_Ops::delete_file(), Zeni::File_Ops::get_appdata_path(), Zeni::get_File_Ops(), Zeni::get_Video(), preinit_from_file(), save(), and set_failsafe_defaults().
|
pure virtual |
Rotate the scene.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Referenced by Zeni::Model::render(), and rotate_scene().
|
inline |
Rotate the scene.
Definition at line 122 of file Video.hxx.
References Zeni::Quaternion::get_rotation(), and rotate_scene().
Save options.
Definition at line 389 of file Video.cpp.
References Zeni::File_Ops::copy_file(), Zeni::File_Ops::create_directory(), file, Zeni::Textures::get_anisotropic_filtering(), Zeni::File_Ops::get_appdata_path(), Zeni::Textures::get_bilinear_filtering(), Zeni::get_File_Ops(), Zeni::Window::get_height(), Zeni::Textures::get_mipmapping(), Zeni::Window::get_width(), Zeni::Window::is_full_screen(), Zeni::XML_Document::load(), Zeni::XML_Element::set_bool(), Zeni::XML_Element::set_int(), Zeni::XML_Element::set_string(), Zeni::XML_Document::try_load(), Zeni::XML_Document::try_save(), ZENI_VIDEO_DX9, ZENI_VIDEO_GL_FIXED, and ZENI_VIDEO_GL_SHADER.
Referenced by Zeni::Gamestate_Base::on_video_resize(), and revert().
Scale the scene.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Referenced by Zeni::Model::render().
|
pure virtual |
Select the world (model view) matrix; Call before [translate/rotate/scale] scene.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
|
inline |
Set the default 2D view filling the entire display area.
Definition at line 93 of file Video.hxx.
References get_render_target_size(), set_2d_view(), Zeni::Point2i::x, and Zeni::Point2i::y.
Referenced by Zeni::Video_GL_Shader::init(), Zeni::Video_DX9::init_context(), Zeni::Widget_Gamestate::render(), Zeni::Popup_State::render(), and Zeni::Gamestate_Base::render().
|
inline |
Set a 2D view for the entire viewing area.
Definition at line 99 of file Video.hxx.
References get_render_target_size(), and set_2d_view().
|
pure virtual |
Set a 2D view for a viewport.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 153 of file Video.cpp.
References calculate_viewport(), get_pixel_offset(), get_viewport(), Zeni::Matrix4f::Identity(), Zeni::Matrix4f::Orthographic(), set_projection_matrix(), set_view_matrix(), set_viewport(), Zeni::Point2f::x, Zeni::Point2f::y, ZENI_2D_FAR, and ZENI_2D_NEAR.
Referenced by set_2d(), Zeni::Video_GL_Shader::set_2d_view(), and Zeni::Video_DX9::set_2d_view().
Set a 3D view filling the entire display area.
Definition at line 105 of file Video.hxx.
References get_render_target_size(), and set_3d_view().
|
pure virtual |
Set a 3D view for a viewport.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 174 of file Video.cpp.
References Zeni::Camera::get_projection_matrix(), Zeni::Camera::get_view_matrix(), set_projection_matrix(), set_view_matrix(), and set_viewport().
Referenced by set_3d(), Zeni::Video_GL_Shader::set_3d_view(), and Zeni::Video_DX9::set_3d_view().
|
pure virtual |
Set the alpha test.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 202 of file Video.cpp.
Referenced by Zeni::Video_GL_Shader::set_alpha_test(), and Zeni::Video_DX9::set_alpha_test().
Set ambient lighting on/off.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 222 of file Video.cpp.
Referenced by Zeni::Video_GL_Shader::set_ambient_lighting(), and Zeni::Video_DX9::set_ambient_lighting().
Set backface culling on/off.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 186 of file Video.cpp.
Referenced by Zeni::Video_GL_Shader::set_backface_culling(), and Zeni::Video_DX9::set_backface_culling().
Set the blank background color.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 214 of file Video.cpp.
Referenced by Zeni::Widget_Gamestate::on_pop(), Zeni::Title_State< PLAY_STATE, INSTRUCTIONS_STATE >::perform_logic(), Zeni::Video_GL_Shader::set_clear_Color(), Zeni::Video_DX9::set_clear_Color(), Zeni::Title_State< PLAY_STATE, INSTRUCTIONS_STATE >::Title_State(), and Zeni::Title_State< PLAY_STATE, INSTRUCTIONS_STATE >::~Title_State().
Set the current color.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 210 of file Video.cpp.
Referenced by Zeni::Font_FT::render_text(), Zeni::Video_GL_Shader::set_Color(), and Zeni::Video_DX9::set_Color().
|
static |
Set failsafe default options.
Definition at line 511 of file Video.cpp.
References Zeni::Window::set_failsafe_defaults(), Zeni::Textures::set_texturing_mode(), ZENI_VIDEO_ANY, ZENI_VIDEO_DX9, ZENI_VIDEO_GL_FIXED, and ZENI_VIDEO_GL_SHADER.
Referenced by revert().
Set Fog.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 295 of file Video.cpp.
Referenced by Zeni::Video_GL_Shader::set_Fog(), and Zeni::Video_DX9::set_Fog().
Set a particular Light.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 283 of file Video.cpp.
References light.
Referenced by Zeni::Video_GL_Shader::set_Light(), and Zeni::Video_DX9::set_Light().
Set lighting on/off.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 218 of file Video.cpp.
Referenced by Zeni::Video_GL_Shader::set_lighting(), and Zeni::Video_DX9::set_lighting().
Set a Material.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Referenced by Zeni::Renderable::pre_render(), and Zeni::render().
Enable a program.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Set the projection Matrix4f.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 230 of file Video.cpp.
Referenced by set_2d_view(), set_3d_view(), Zeni::Video_GL_Shader::set_projection_matrix(), and Zeni::Video_DX9::set_projection_matrix().
Set a render target.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Set vertical_sync on/off.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 190 of file Video.cpp.
Referenced by Zeni::Video_GL_Shader::set_vertical_sync(), and Zeni::Video_DX9::set_vertical_sync().
Set the view Matrix4f.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 226 of file Video.cpp.
Referenced by set_2d_view(), set_3d_view(), Zeni::Video_GL_Shader::set_view_matrix(), and Zeni::Video_DX9::set_view_matrix().
|
pure virtual |
Set the viewport.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 234 of file Video.cpp.
Referenced by set_2d_view(), set_3d_view(), Zeni::Video_GL_Shader::set_viewport(), Zeni::Video_DX9::set_viewport(), and set_viewport().
void Zeni::Video::set_viewport | ( | const float & | aspect_ratio, |
const std::pair< Point2i, Point2i > & | viewport = std::make_pair(Point2i(), get().get_render_target_size()) |
||
) |
Set the viewport.
Definition at line 238 of file Video.cpp.
References calculate_viewport(), and set_viewport().
Enable or disable testing of the Z-Buffer.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 198 of file Video.cpp.
Referenced by Zeni::Video_GL_Shader::set_ztest(), and Zeni::Video_DX9::set_ztest().
Enable or disable writing to the Z-Buffer.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 194 of file Video.cpp.
Referenced by Zeni::Video_GL_Shader::set_zwrite(), and Zeni::Video_DX9::set_zwrite().
Transform the scene.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Translate the scene.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Referenced by Zeni::Model::render(), Zeni::Widget::render(), and Zeni::Selector::render_impl().
|
pure virtual |
Unapply a texture.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Referenced by Zeni::Font_FT::render_text().
|
pure virtual |
Unset Fog.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 300 of file Video.cpp.
Referenced by Zeni::Video_GL_Shader::unset_Fog(), and Zeni::Video_DX9::unset_Fog().
Unset a particular Light.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Definition at line 287 of file Video.cpp.
Referenced by Zeni::Video_GL_Shader::unset_Light(), and Zeni::Video_DX9::unset_Light().
Unset a Material.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
Referenced by Zeni::Renderable::post_render(), and Zeni::render().
|
pure virtual |
Disable a program.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
|
pure virtual |
Unset a render target.
Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.
|
protected |
Definition at line 244 of file Video.h.
Referenced by Zeni::Video_GL_Shader::create_Fragment_Shader(), Zeni::Video_DX9::create_Fragment_Shader(), Zeni::Video_DX9::destroy_device(), get_fragment_shader_compiler(), Zeni::Video_GL_Shader::init(), Zeni::Video_DX9::init_device(), and Zeni::Video_GL_Shader::uninit().
|
protected |
Definition at line 243 of file Video.h.
Referenced by Zeni::Video_GL_Shader::create_Vertex_Shader(), Zeni::Video_DX9::create_Vertex_Shader(), Zeni::Video_DX9::destroy_device(), get_vertex_shader_compiler(), Zeni::Video_GL_Shader::init(), Zeni::Video_DX9::init_device(), and Zeni::Video_GL_Shader::uninit().