//---------------------------------------------------------------------------- // William Baxter III's Ray Tracer // // Project for Comp 238, Raster Graphics // University of North Carolina at Chapel Hill // // $Id:$ //---------------------------------------------------------------------------- #ifndef WB3TEXTURESET_H #define WB3TEXTURESET_H //---------------------------------------------------------------------------- // The TextureSet class manages a set of textures used in shading // a single primitive. A single primitive could use multiple bitmap // textures to modulate each of the components (ambient, diffuse, specular) // its material. So a TextureSet contains an array of lists of pointers // to textures. //---------------------------------------------------------------------------- #include #include "wb3Components.hpp" #include "wb3Texture.hpp" typedef std::list wb3TextureList; class wb3TextureSet { public: wb3TextureSet() ; ~wb3TextureSet() ; const wb3TextureList* GetTextureList(wb3Component::ComponentType t) const; void AddTexture(wb3Texture *tex, wb3Component::ComponentType typ); protected: wb3TextureList m_lists[wb3Component::MAX_COMPONENT]; }; //---------------------------------------------------------------------------- inline const wb3TextureList* wb3TextureSet::GetTextureList( wb3Component::ComponentType type) const { return &m_lists[type]; } //---------------------------------------------------------------------------- inline void wb3TextureSet::AddTexture( wb3Texture *tex, wb3Component::ComponentType type) { m_lists[type].push_back(tex); } //---------------------------------------------------------------------------- #endif