texture_cube_array.inl 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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_array.inl
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////
  9. namespace gli
  10. {
  11. inline textureCubeArray::textureCubeArray()
  12. {}
  13. inline textureCubeArray::textureCubeArray
  14. (
  15. layer_type const & Layers,
  16. level_type const & Levels
  17. )
  18. {
  19. this->Arrays.resize(Layers);
  20. for(textureCubeArray::size_type i = 0; i < this->Arrays.size(); ++i)
  21. this->Arrays[i].resize(Levels);
  22. }
  23. inline textureCubeArray::~textureCubeArray()
  24. {}
  25. inline textureCube & textureCubeArray::operator[]
  26. (
  27. layer_type const & Layer
  28. )
  29. {
  30. return this->Arrays[Layer];
  31. }
  32. inline textureCube const & textureCubeArray::operator[]
  33. (
  34. layer_type const & Layer
  35. ) const
  36. {
  37. return this->Arrays[Layer];
  38. }
  39. inline bool textureCubeArray::empty() const
  40. {
  41. return this->Arrays.empty();
  42. }
  43. inline textureCubeArray::format_type textureCubeArray::format() const
  44. {
  45. return this->Arrays.empty() ? FORMAT_NULL : this->Arrays[0].format();
  46. }
  47. inline textureCubeArray::level_type textureCubeArray::levels() const
  48. {
  49. if(this->empty())
  50. return 0;
  51. return this->Arrays[0].levels();
  52. }
  53. inline void textureCubeArray::resize
  54. (
  55. layer_type const & Layers,
  56. level_type const & Levels
  57. )
  58. {
  59. for(textureCubeArray::size_type i = 0; i < this->Arrays.size(); ++i)
  60. this->Arrays[i].resize(Levels);
  61. }
  62. }//namespace gli