zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Zeni::Video Class Referenceabstract

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, Point2icalculate_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, Point2icalculate_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 Fontcreate_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 Shadercreate_Fragment_Shader (const String &filename)=0
 Create a Fragment_Shader from a file. More...
 
virtual Programcreate_Program ()=0
 Create a Program from a file. More...
 
virtual Texturecreate_Texture (const Image &image)=0
 Function for creating a Texture from an Image. More...
 
virtual Texturecreate_Texture (const Point2i &size, const bool &repeat)=0
 Function for creating a Texture for render-to-texture. More...
 
virtual Vertex_Buffer_Renderercreate_Vertex_Buffer_Renderer (Vertex_Buffer &vertex_buffer)=0
 Function for creating a Vertex_Buffer_Renderer. More...
 
virtual Shadercreate_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 Colorget_clear_Color () const
 Get the blank background color. More...
 
const Colorget_Color () const
 Get the current color. More...
 
const Fogget_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 Lightget_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 Matrix4fget_projection_matrix () const
 Get the projection Matrix4f. More...
 
virtual const Point2iget_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 Matrix4fget_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 Textureload_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...
 
- Public Member Functions inherited from Zeni::Singleton< Video >
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 Colorget_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 Public Member Functions inherited from Zeni::Singleton< Video >
static void completely_destroy ()
 
static void destroy ()
 
static Videoget ()
 
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...
 
- Protected Member Functions inherited from Zeni::Singleton< Video >
 Singleton ()
 
virtual ~Singleton ()
 

Protected Attributes

ShHandle m_fragment_compiler
 
ShHandle m_vertex_compiler
 

Friends

class Singleton< Video >
 

Detailed Description

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.

Author
bazald

Contact: bazal.nosp@m.d@ze.nosp@m.nipex.nosp@m..com

Definition at line 71 of file Video.h.

Member Enumeration Documentation

Enumerator
ZENI_NEVER 
ZENI_LESS 
ZENI_EQUAL 
ZENI_GREATER 
ZENI_NOT_EQUAL 
ZENI_LESS_OR_EQUAL 
ZENI_GREATER_OR_EQUAL 
ZENI_ALWAYS 

Definition at line 98 of file Video.h.

Enumerator
ZENI_VIDEO_ANY 
ZENI_VIDEO_GL_FIXED 
ZENI_VIDEO_DX9 
ZENI_VIDEO_GL_SHADER 

Definition at line 96 of file Video.h.

Constructor & Destructor Documentation

Zeni::Video::~Video ( )
protectedpure virtual

Definition at line 145 of file Video.cpp.

References Zeni::Singleton< Window >::remove_pre_uninit().

Member Function Documentation

void Zeni::Video::apply_Texture ( const String name)
inline
virtual void Zeni::Video::apply_Texture ( const unsigned long &  id)
pure virtual

Apply a texture by id.

Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.

virtual void Zeni::Video::apply_Texture ( const Texture texture)
pure virtual

Apply a texture by id.

Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.

virtual bool Zeni::Video::begin_prerender ( )
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().

virtual bool Zeni::Video::begin_render ( )
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().

std::pair< Point2i, Point2i > Zeni::Video::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.

Definition at line 249 of file Video.cpp.

References int.

virtual void Zeni::Video::clear_depth_buffer ( )
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().

virtual void Zeni::Video::clear_render_target ( const Color color = Color(0.0f, 0.0f, 0.0f, 0.0f))
pure virtual

Clear the viewport.

Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.

virtual Font* Zeni::Video::create_Font ( const String filename,
const float &  glyph_height,
const float &  virtual_screen_height 
)
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.

virtual Shader* Zeni::Video::create_Fragment_Shader ( const String filename)
pure virtual

Create a Fragment_Shader from a file.

Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.

virtual Program* Zeni::Video::create_Program ( )
pure virtual

Create a Program from a file.

Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.

virtual Texture* Zeni::Video::create_Texture ( const Image image)
pure virtual

Function for creating a Texture from an Image.

Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.

virtual Texture* Zeni::Video::create_Texture ( const Point2i size,
const bool &  repeat 
)
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.

virtual Vertex_Buffer_Renderer* Zeni::Video::create_Vertex_Buffer_Renderer ( Vertex_Buffer vertex_buffer)
pure virtual
virtual Shader* Zeni::Video::create_Vertex_Shader ( const String filename)
pure virtual

Create a Vertex_Shader from a file.

Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.

virtual void Zeni::Video::end_render ( )
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().

Video::TEST Zeni::Video::get_alpha_test_function ( ) const
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().

float Zeni::Video::get_alpha_test_value ( ) const
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().

const Color & Zeni::Video::get_ambient_lighting ( )
inlinestatic

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().

bool Zeni::Video::get_backface_culling ( )
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().

const Color & Zeni::Video::get_clear_Color ( ) const
inline
const Color & Zeni::Video::get_Color ( ) const
inline

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().

const Fog * Zeni::Video::get_Fog ( ) const

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().

ShHandle Zeni::Video::get_fragment_shader_compiler ( ) const
inline

Get the fragment shader compiler.

Definition at line 89 of file Video.hxx.

References m_fragment_compiler.

const Light * Zeni::Video::get_Light ( const int number) const

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().

bool Zeni::Video::get_lighting ( )
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().

virtual int Zeni::Video::get_maximum_anisotropy ( ) const
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().

int Zeni::Video::get_multisampling ( )
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().

bool Zeni::Video::get_normal_interpolation ( )
inlinestatic

Determine whether normal interpolation is enabled.

Definition at line 49 of file Video.hxx.

virtual Point2f Zeni::Video::get_pixel_offset ( ) const
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().

const Matrix4f & Zeni::Video::get_projection_matrix ( ) const
inline

Get the projection Matrix4f.

Definition at line 131 of file Video.hxx.

virtual const Point2i& Zeni::Video::get_render_target_size ( ) const
pure virtual

Get the dimensions of the render target.

Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.

Referenced by set_2d(), and set_3d().

ShHandle Zeni::Video::get_vertex_shader_compiler ( ) const
inline

Get the vertex shader compiler.

Definition at line 85 of file Video.hxx.

References m_vertex_compiler.

bool Zeni::Video::get_vertical_sync ( )
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().

Video::VIDEO_MODE Zeni::Video::get_video_mode ( )
inlinestatic

Get the currently selected video mode.

Definition at line 33 of file Video.hxx.

const Matrix4f & Zeni::Video::get_view_matrix ( ) const
inline

Get the view Matrix4f.

Definition at line 127 of file Video.hxx.

const std::pair< Point2i, Point2i > & Zeni::Video::get_viewport ( ) const
inline

Get the viewport.

Definition at line 135 of file Video.hxx.

Referenced by set_2d_view().

virtual bool Zeni::Video::has_vertex_buffers ( ) const
pure virtual

Determine whether Vertex_Buffers are supported.

Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.

bool Zeni::Video::is_3d ( ) const
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().

bool Zeni::Video::is_alpha_test_enabled ( ) const
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().

bool Zeni::Video::is_ztest_enabled ( ) const
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().

bool Zeni::Video::is_zwrite_enabled ( ) const
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().

virtual Texture* Zeni::Video::load_Texture ( const String filename,
const bool &  repeat,
const bool &  lazy_loading = false 
)
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.

virtual void Zeni::Video::pop_world_stack ( )
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().

void Zeni::Video::preinit_from_file ( const String filename)
static

Set rendering options from a file.

Definition at line 336 of file Video.cpp.

References file.

Referenced by change_resolution(), and revert().

void Zeni::Video::preinit_multisampling ( const int multisampling = 0)
static

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().

void Zeni::Video::preinit_vertical_sync ( const bool &  vertical_sync = false)
static

Set vertical_sync to true.

Definition at line 332 of file Video.cpp.

Referenced by load_config(), and preinit_from_file().

void Zeni::Video::preinit_video_mode ( const VIDEO_MODE vm = ZENI_VIDEO_ANY)
static

Set which rendering engine to use.

Definition at line 324 of file Video.cpp.

Referenced by load_config(), and preinit_from_file().

void Zeni::Video::print_errors ( )
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().

virtual void Zeni::Video::push_world_stack ( )
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().

bool Zeni::Video::revert ( )
static
virtual void Zeni::Video::rotate_scene ( const Vector3f about,
const float &  radians 
)
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().

void Zeni::Video::rotate_scene ( const Quaternion rotation)
inline

Rotate the scene.

Definition at line 122 of file Video.hxx.

References Zeni::Quaternion::get_rotation(), and rotate_scene().

virtual void Zeni::Video::scale_scene ( const Vector3f factor)
pure virtual

Scale the scene.

Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.

Referenced by Zeni::Model::render().

virtual void Zeni::Video::select_world_matrix ( )
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.

void Zeni::Video::set_2d ( )
inline
void Zeni::Video::set_2d ( const std::pair< Point2f, Point2f > &  camera2d,
const bool &  fix_aspect_ratio = false 
)
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().

void Zeni::Video::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 
)
pure virtual
void Zeni::Video::set_3d ( const Camera camera)
inline

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().

void Zeni::Video::set_3d_view ( const Camera camera,
const std::pair< Point2i, Point2i > &  viewport = std::make_pair(Point2i(), get().get_render_target_size()) 
)
pure virtual
void Zeni::Video::set_alpha_test ( const bool &  enabled,
const TEST test = ZENI_ALWAYS,
const float &  value = 0.0f 
)
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().

void Zeni::Video::set_ambient_lighting ( const Color color)
pure virtual

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().

void Zeni::Video::set_backface_culling ( const bool &  on)
pure virtual

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().

void Zeni::Video::set_Color ( const Color color)
pure virtual
void Zeni::Video::set_failsafe_defaults ( )
static
void Zeni::Video::set_Fog ( const Fog fog)
pure virtual
void Zeni::Video::set_Light ( const int number,
const Light light 
)
pure virtual

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().

void Zeni::Video::set_lighting ( const bool &  on = true)
pure virtual

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().

virtual void Zeni::Video::set_Material ( const Material material)
pure virtual
virtual void Zeni::Video::set_program ( Program program)
pure virtual

Enable a program.

Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.

void Zeni::Video::set_projection_matrix ( const Matrix4f projection)
pure virtual
virtual void Zeni::Video::set_render_target ( Texture texture)
pure virtual

Set a render target.

Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.

void Zeni::Video::set_vertical_sync ( const bool &  on)
pure virtual

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().

void Zeni::Video::set_view_matrix ( const Matrix4f view)
pure virtual
void Zeni::Video::set_viewport ( const std::pair< Point2i, Point2i > &  viewport = std::make_pair(Point2i(), get().get_render_target_size()))
pure virtual
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().

void Zeni::Video::set_ztest ( const bool &  enabled)
pure virtual

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().

void Zeni::Video::set_zwrite ( const bool &  enabled)
pure virtual

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().

virtual void Zeni::Video::transform_scene ( const Matrix4f transformation)
pure virtual

Transform the scene.

Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.

virtual void Zeni::Video::translate_scene ( const Vector3f direction)
pure virtual
virtual void Zeni::Video::unapply_Texture ( )
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().

void Zeni::Video::unset_Fog ( )
pure virtual
void Zeni::Video::unset_Light ( const int number)
pure virtual

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().

virtual void Zeni::Video::unset_Material ( const Material material)
pure virtual
virtual void Zeni::Video::unset_program ( )
pure virtual

Disable a program.

Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.

virtual void Zeni::Video::unset_render_target ( )
pure virtual

Unset a render target.

Implemented in Zeni::Video_DX9, Zeni::Video_GL_Fixed, and Zeni::Video_GL_Shader.

Friends And Related Function Documentation

friend class Singleton< Video >
friend

Definition at line 72 of file Video.h.

Member Data Documentation


The documentation for this class was generated from the following files: