IMeshTextureLoader.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // This file is part of the "Irrlicht Engine".
  2. // For conditions of distribution and use, see copyright notice in irrlicht.h
  3. #ifndef IRR_I_MESH_TEXTURE_LOADER_H_INCLUDED
  4. #define IRR_I_MESH_TEXTURE_LOADER_H_INCLUDED
  5. #include "path.h"
  6. #include "IReferenceCounted.h"
  7. namespace irr
  8. {
  9. namespace video
  10. {
  11. class ITexture;
  12. }
  13. namespace io
  14. {
  15. class IReadFile;
  16. }
  17. namespace scene
  18. {
  19. //! Finding and loading textures inside meshloaders.
  20. /** A texture loader can search for a texture in several paths.
  21. For example relative to a given texture-path, relative to the current
  22. working directory or relative to a mesh- and/or material-file.
  23. */
  24. class IMeshTextureLoader : public virtual IReferenceCounted
  25. {
  26. public:
  27. //! Destructor
  28. virtual ~IMeshTextureLoader() {}
  29. //! Set a custom texture path.
  30. /** This is the first path the texture-loader should search. */
  31. virtual void setTexturePath(const irr::io::path& path) = 0;
  32. //! Get the current custom texture path.
  33. virtual const irr::io::path& getTexturePath() const = 0;
  34. //! Get the texture by searching for it in all paths that makes sense for the given textureName.
  35. /** Usually you do not have to use this method, it is used internally by IMeshLoader's.
  36. \param textureName Texturename as used in the mesh-format
  37. \return Pointer to the texture. Returns 0 if loading failed.*/
  38. virtual irr::video::ITexture* getTexture(const irr::io::path& textureName) = 0;
  39. //! Meshloaders will search paths relative to the meshFile.
  40. /** Usually you do not have to use this method, it is used internally by IMeshLoader's.
  41. Any values you set here will likely be overwritten internally. */
  42. virtual void setMeshFile(const irr::io::IReadFile* meshFile) = 0;
  43. //! Meshloaders will try to look relative to the path of the materialFile
  44. /** Usually you do not have to use this method, it is used internally by IMeshLoader's.
  45. Any values you set here will likely be overwritten internally. */
  46. virtual void setMaterialFile(const irr::io::IReadFile* materialFile) = 0;
  47. };
  48. } // end namespace scene
  49. } // end namespace irr
  50. #endif