3 This file is part of libmspgl
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GL_OBJECT_H_
9 #define MSP_GL_OBJECT_H_
12 #include <msp/datafile/collection.h>
25 Stores data for a complete 3D object. This includes a mesh, a shader and data
26 for it and a number of textures. Only the mesh is mandatory, other components
29 See also class ObjectInstance.
35 std::vector<Texture *> textures;
41 class Loader: public DataFile::Loader
44 typedef DataFile::Collection Collection;
50 std::vector<std::string> textures;
53 Loader(Object &, Collection &);
56 Object &get_object() const { return obj; }
57 Collection &get_collection() const { return coll; }
59 void shader(const std::string &);
60 void texture(const std::string &);
66 Program *get_shader() const { return shprog; }
69 Renders the object. If an ObjectInstance is provided, its hook functions
72 void render(const ObjectInstance * =0) const;
75 Renders multiple instances of the object in one go. This may be a
76 performance improvement, as the object-specific render setup only has to be
79 void render(const std::list<const ObjectInstance *> &) const;
81 void setup_render() const;
82 void finish_render() const;