texture_cube.hpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // OpenGL Image Copyright (c) 2008 - 2011 G-Truc Creation (www.g-truc.net)
  3. ///////////////////////////////////////////////////////////////////////////////////////////////////
  4. // Created : 2011-04-06
  5. // Updated : 2011-04-06
  6. // Licence : This source is under MIT License
  7. // File : gli/core/texture_cube.hpp
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////
  9. #ifndef GLI_CORE_TEXTURE_CUBE_INCLUDED
  10. #define GLI_CORE_TEXTURE_CUBE_INCLUDED
  11. #include "texture2d.hpp"
  12. namespace gli
  13. {
  14. enum face
  15. {
  16. POSITIVE_X,
  17. NEGATIVE_X,
  18. POSITIVE_Y,
  19. NEGATIVE_Y,
  20. POSITIVE_Z,
  21. NEGATIVE_Z,
  22. FACE_MAX
  23. };
  24. class textureCube
  25. {
  26. public:
  27. typedef texture2D::dimensions_type dimensions_type;
  28. typedef texture2D::texcoord_type texcoord_type;
  29. typedef texture2D::size_type size_type;
  30. typedef texture2D::value_type value_type;
  31. typedef texture2D::format_type format_type;
  32. typedef texture2D::data_type data_type;
  33. typedef texture2D::level_type level_type;
  34. typedef face face_type;
  35. public:
  36. textureCube();
  37. explicit textureCube(level_type const & Levels);
  38. ~textureCube();
  39. texture2D & operator[] (
  40. face_type const & Face);
  41. texture2D const & operator[] (
  42. face_type const & Face) const;
  43. bool empty() const;
  44. format_type format() const;
  45. level_type levels() const;
  46. void resize(level_type const & Levels);
  47. private:
  48. std::vector<texture2D> Faces;
  49. };
  50. }//namespace gli
  51. #include "texture_cube.inl"
  52. #endif//GLI_CORE_TEXTURE_CUBE_INCLUDED