Texture.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. Copyright (c) 2013 Daniele Bartolini, Michele Rossi
  3. Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
  4. Permission is hereby granted, free of charge, to any person
  5. obtaining a copy of this software and associated documentation
  6. files (the "Software"), to deal in the Software without
  7. restriction, including without limitation the rights to use,
  8. copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. copies of the Software, and to permit persons to whom the
  10. Software is furnished to do so, subject to the following
  11. conditions:
  12. The above copyright notice and this permission notice shall be
  13. included in all copies or substantial portions of the Software.
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  15. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  16. OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  17. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  18. HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  19. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  21. OTHER DEALINGS IN THE SOFTWARE.
  22. */
  23. #pragma once
  24. #include "Types.h"
  25. namespace crown
  26. {
  27. // Max number of textures a renderer can hold.
  28. const uint32_t MAX_TEXTURES = 4096;
  29. enum TextureMode
  30. {
  31. TM_MODULATE = 0, // Multiplies texel color by the geometry color after lighting
  32. TM_REPLACE = 1, // Replaces the fragment color with the texel color
  33. TM_DECAL = 2, // WTF?
  34. TM_BLEND = 3, // Blends the texel color with a constant blending color
  35. TM_ADD = 4, // Adds the texel color to the fragment color
  36. TM_COUNT
  37. };
  38. /// Enumerates the hardware filter to use when applying a texture
  39. enum TextureFilter
  40. {
  41. TF_NEAREST = 0,
  42. TF_LINEAR = 1,
  43. TF_BILINEAR = 2,
  44. TF_TRILINEAR = 3,
  45. TF_ANISOTROPIC = 4,
  46. TF_COUNT
  47. };
  48. /// Enumerates the wrapping mode to use when applying a texture
  49. enum TextureWrap
  50. {
  51. TW_REPEAT = 0,
  52. TW_CLAMP = 1,
  53. TW_CLAMP_TO_EDGE = 2,
  54. TW_CLAMP_TO_BORDER = 3,
  55. TW_COUNT
  56. };
  57. } // namespace crown