]> git.tdb.fi Git - libs/gl.git/blobdiff - source/object.h
Add class Renderable
[libs/gl.git] / source / object.h
index e38afb5c4c1b16fb92946785143bed0fb4824a6d..f0940652992692bfce462258cf0d4a72e58b48ec 100644 (file)
@@ -11,6 +11,7 @@ Distributed under the LGPL
 #include <vector>
 #include <msp/datafile/collection.h>
 #include "objectpass.h"
+#include "renderable.h"
 
 namespace Msp {
 namespace GL {
@@ -29,7 +30,7 @@ are optional.
 
 See also class ObjectInstance.
 */
-class Object
+class Object: public Renderable
 {
 private:
        std::vector<Mesh *> meshes;
@@ -68,15 +69,17 @@ public:
        Object();
        ~Object();
 
-       bool has_pass(const std::string &) const;
+       virtual bool has_pass(const std::string &) const;
        const ObjectPass &get_pass(const std::string &) const;
 
        /**
        Renders the object.  If an ObjectInstance is provided, its hook functions
        are called.
        */
-       void render(const ObjectInstance * =0) const;
-       void render(const std::string &, const ObjectInstance *) const;
+       virtual void render() const;
+       virtual void render(const ObjectInstance &) const;
+       virtual void render(const std::string &) const;
+       virtual void render(const std::string &, const ObjectInstance &) const;
 
        /**
        Renders multiple instances of the object in one go.  This may be a