config.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /**************************************************************************/
  2. /* config.h */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #ifndef CONFIG_GLES3_H
  31. #define CONFIG_GLES3_H
  32. #ifdef GLES3_ENABLED
  33. #include "core/string/ustring.h"
  34. #include "core/templates/hash_set.h"
  35. // This must come first to avoid windows.h mess
  36. #include "platform_config.h"
  37. #ifndef OPENGL_INCLUDE_H
  38. #include <GLES3/gl3.h>
  39. #else
  40. #include OPENGL_INCLUDE_H
  41. #endif
  42. #ifdef ANDROID_ENABLED
  43. typedef void (*PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)(GLenum, GLenum, GLuint, GLint, GLint, GLsizei);
  44. #endif
  45. namespace GLES3 {
  46. class Config {
  47. private:
  48. static Config *singleton;
  49. public:
  50. bool use_nearest_mip_filter = false;
  51. bool use_depth_prepass = true;
  52. int max_vertex_texture_image_units = 0;
  53. int max_texture_image_units = 0;
  54. int max_texture_size = 0;
  55. int max_viewport_size[2] = { 0, 0 };
  56. int max_uniform_buffer_size = 0;
  57. int max_renderable_elements = 0;
  58. int max_renderable_lights = 0;
  59. int max_lights_per_object = 0;
  60. // TODO implement wireframe in OpenGL
  61. // bool generate_wireframes;
  62. HashSet<String> extensions;
  63. bool float_texture_supported = false;
  64. bool s3tc_supported = false;
  65. bool rgtc_supported = false;
  66. bool bptc_supported = false;
  67. bool etc2_supported = false;
  68. bool astc_supported = false;
  69. bool astc_hdr_supported = false;
  70. bool astc_layered_supported = false;
  71. bool force_vertex_shading = false;
  72. bool support_anisotropic_filter = false;
  73. float anisotropic_level = 0.0f;
  74. bool multiview_supported = false;
  75. #ifdef ANDROID_ENABLED
  76. PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC eglFramebufferTextureMultiviewOVR = nullptr;
  77. #endif
  78. static Config *get_singleton() { return singleton; };
  79. Config();
  80. ~Config();
  81. };
  82. } // namespace GLES3
  83. #endif // GLES3_ENABLED
  84. #endif // CONFIG_GLES3_H