X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Frender%2Fobject.h;h=ac62c702b4e1e2f9c6033c40e95e2db812b84735;hb=f19366d32cc29287a2730cfba90893e407754081;hp=48e3045930559fd354af6d868a935100a2fab09d;hpb=7aaec9a70b8d7733429bec043f8e33e02956f266;p=libs%2Fgl.git diff --git a/source/render/object.h b/source/render/object.h index 48e30459..ac62c702 100644 --- a/source/render/object.h +++ b/source/render/object.h @@ -2,7 +2,6 @@ #define MSP_GL_OBJECT_H_ #include -#include "bindable.h" #include "renderable.h" #include "renderpass.h" #include "resourceobserver.h" @@ -10,11 +9,9 @@ namespace Msp { namespace GL { -class Material; class Mesh; class ObjectInstance; class Technique; -class Texture; /** Combines a Mesh with a Technique to give it an appearance. The Technique will @@ -53,10 +50,10 @@ public: class Loader: public LodLoader { public: - Loader(Object &); - Loader(Object &, Collection &); + Loader(Object &o): Loader(o, 0) { } + Loader(Object &o, Collection &c): Loader(o, &c) { } private: - void init(); + Loader(Object &, Collection *); virtual void finish(); void bounding_sphere_hint(float, float, float, float); @@ -66,15 +63,15 @@ public: private: struct LevelOfDetail { - RefPtr mesh; - RefPtr technique; + const Mesh *mesh; + const Technique *technique; }; std::vector lods; Geometry::BoundingSphere bounding_sphere; bool lod0_watched; - static Matrix identity_matrix; + static const Matrix identity_matrix; public: Object(); @@ -110,18 +107,18 @@ public: virtual const Matrix *get_matrix() const { return &identity_matrix; } virtual const Geometry::BoundingSphere *get_bounding_sphere() const { return &bounding_sphere; } - virtual void render(Renderer &, const Tag & = Tag()) const; + virtual void render(Renderer &, Tag = Tag()) const; /** Renders an instance of the object. The instance's hook functions are called before and after drawing the mesh. */ - virtual void render(Renderer &, const ObjectInstance &, const Tag & = Tag()) const; + virtual void render(Renderer &, const ObjectInstance &, Tag = Tag()) const; protected: - virtual void setup_render(Renderer &, const Tag &) const { } - virtual void finish_render(Renderer &, const Tag &) const { } + virtual void setup_render(Renderer &, Tag) const { } + virtual void finish_render(Renderer &, Tag) const { } private: - const RenderPass *get_pass(const Tag &, unsigned) const; + const RenderPass *get_pass(Tag, unsigned) const; virtual void resource_loaded(Resource &); virtual void resource_removed(Resource &);