config.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*************************************************************************/
  2. /* config.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
  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. int uniform_buffer_offset_alignment = 0;
  61. // TODO implement wireframe in OpenGL
  62. // bool generate_wireframes;
  63. HashSet<String> extensions;
  64. bool float_texture_supported = false;
  65. bool s3tc_supported = false;
  66. bool rgtc_supported = false;
  67. bool bptc_supported = false;
  68. bool etc2_supported = false;
  69. bool force_vertex_shading = false;
  70. bool support_anisotropic_filter = false;
  71. float anisotropic_level = 0.0f;
  72. bool multiview_supported = false;
  73. #ifdef ANDROID_ENABLED
  74. PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC eglFramebufferTextureMultiviewOVR = nullptr;
  75. #endif
  76. static Config *get_singleton() { return singleton; };
  77. Config();
  78. ~Config();
  79. };
  80. } // namespace GLES3
  81. #endif // GLES3_ENABLED
  82. #endif // CONFIG_GLES3_H