2
0

GLUtils.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. #include "GLUtils.h"
  24. namespace crown
  25. {
  26. //-----------------------------------------------------------------------------
  27. const GLenum GL::COMPARE_FUNCTION_TABLE[CF_COUNT] =
  28. {
  29. GL_NEVER,
  30. GL_LESS,
  31. GL_EQUAL,
  32. GL_LEQUAL,
  33. GL_GREATER,
  34. GL_NOTEQUAL,
  35. GL_GEQUAL,
  36. GL_ALWAYS
  37. };
  38. //-----------------------------------------------------------------------------
  39. const GLenum GL::BLEND_FUNCTION_TABLE[BF_COUNT] =
  40. {
  41. GL_ZERO,
  42. GL_ONE,
  43. GL_SRC_COLOR,
  44. GL_ONE_MINUS_SRC_COLOR,
  45. GL_DST_COLOR,
  46. GL_ONE_MINUS_DST_COLOR,
  47. GL_SRC_ALPHA,
  48. GL_ONE_MINUS_SRC_ALPHA,
  49. GL_DST_ALPHA,
  50. GL_ONE_MINUS_DST_ALPHA,
  51. GL_CONSTANT_COLOR,
  52. GL_ONE_MINUS_CONSTANT_COLOR,
  53. GL_CONSTANT_ALPHA,
  54. GL_ONE_MINUS_CONSTANT_ALPHA,
  55. GL_SRC_ALPHA_SATURATE
  56. };
  57. //-----------------------------------------------------------------------------
  58. const GLenum GL::BLEND_EQUATION_TABLE[BE_COUNT] =
  59. {
  60. GL_FUNC_ADD,
  61. GL_FUNC_SUBTRACT,
  62. GL_FUNC_REVERSE_SUBTRACT,
  63. GL_MIN,
  64. GL_MAX
  65. };
  66. //-----------------------------------------------------------------------------
  67. const GLenum GL::TEXTURE_WRAP_TABLE[TW_COUNT] =
  68. {
  69. GL_REPEAT,
  70. GL_CLAMP,
  71. GL_CLAMP_TO_EDGE,
  72. GL_CLAMP_TO_BORDER
  73. };
  74. //-----------------------------------------------------------------------------
  75. const GLenum GL::TEXTURE_MIN_FILTER_TABLE[TF_COUNT] =
  76. {
  77. GL_NEAREST,
  78. GL_LINEAR,
  79. GL_NEAREST_MIPMAP_LINEAR,
  80. GL_LINEAR_MIPMAP_LINEAR,
  81. GL_LINEAR_MIPMAP_LINEAR
  82. };
  83. //-----------------------------------------------------------------------------
  84. const GLenum GL::TEXTURE_MAG_FILTER_TABLE[TF_COUNT] =
  85. {
  86. GL_NEAREST,
  87. GL_LINEAR,
  88. GL_LINEAR,
  89. GL_LINEAR,
  90. GL_LINEAR
  91. };
  92. //-----------------------------------------------------------------------------
  93. const GLenum GL::POLYGON_MODE_TABLE[PM_COUNT] =
  94. {
  95. GL_POINT,
  96. GL_LINE,
  97. GL_FILL
  98. };
  99. } // namespace crown