zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Renderable.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 
33 #ifndef ZENI_RENDERABLE_H
34 #define ZENI_RENDERABLE_H
35 
36 #include <Zeni/Core.h>
37 
38 namespace Zeni {
39 
40  class ZENI_GRAPHICS_DLL Material;
41 
42  class ZENI_GRAPHICS_DLL Video_GL_Fixed;
43  class ZENI_GRAPHICS_DLL Video_GL_Shader;
44  class ZENI_GRAPHICS_DLL Video_DX9;
45 
46  // For any object that knows how to render itself
47  class ZENI_GRAPHICS_DLL Renderable {
48  public:
49  inline Renderable();
50  virtual ~Renderable();
51 
52  inline Renderable(const Renderable &rhs);
53  inline Renderable & operator=(const Renderable &rhs);
54 
56  virtual bool is_3d() const = 0;
57 
58 #ifndef DISABLE_GL_FIXED
59  virtual void render_to(Video_GL_Fixed &screen) const = 0;
60 #endif
61 
62 #ifndef DISABLE_GL_SHADER
63  virtual void render_to(Video_GL_Shader &screen) const = 0;
64 #endif
65 
66 #ifndef DISABLE_DX9
67  virtual void render_to(Video_DX9 &screen) const = 0;
68 #endif
69 
70  virtual void pre_render() const;
71  virtual void post_render() const;
72 
75  inline const Material * get_Material() const;
76  void give_Material(Material * const &material);
77  void lend_Material(const Material * const &material);
78  void fax_Material(const Material * const &material);
79 
80  private:
81  Material * m_material;
82  bool delete_m_material;
83  };
84 
85  struct ZENI_GRAPHICS_DLL Invalid_Vertex_Index : public Error {
86  Invalid_Vertex_Index() : Error("Invalid Vertex Index") {}
87  };
88 
89 }
90 
91 #endif
The Direct3D9 Rendering System.
Definition: Video_DX9.h:62
An Abstraction of a Material.
Definition: Material.h:56
A Renderable Interface.
Definition: Renderable.h:47
The OpenGL Rendering System.
The OpenGL Rendering System.
The Error Class.
Definition: Error.h:52