BsGLPrerequisites.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #pragma once
  2. #include "BsCorePrerequisites.h"
  3. namespace BansheeEngine
  4. {
  5. extern String MODULE_NAME;
  6. class GLSupport;
  7. class GLRenderAPI;
  8. class GLTextureCore;
  9. class GLVertexBuffer;
  10. class GLVertexBufferCore;
  11. class GLTextureManager;
  12. class GLContext;
  13. class GLRTTManager;
  14. class GLPixelBuffer;
  15. class GLGpuParamBlock;
  16. class GLSLGpuProgramCore;
  17. class GLVertexArrayObject;
  18. struct GLSLProgramPipeline;
  19. class GLSLProgramPipelineManager;
  20. typedef std::shared_ptr<GLPixelBuffer> GLPixelBufferPtr;
  21. typedef std::shared_ptr<GLGpuParamBlock> GLGpuParamBlockPtr;
  22. /**
  23. * @brief OpenGL specific types to track resource statistics for.
  24. */
  25. enum GLRenderStatResourceType
  26. {
  27. RenderStatObject_PipelineObject = 100,
  28. RenderStatObject_FrameBufferObject,
  29. RenderStatObject_VertexArrayObject
  30. };
  31. }
  32. #if BS_THREAD_SUPPORT == 1
  33. # define GLEW_MX
  34. #endif
  35. #if BS_PLATFORM == BS_PLATFORM_WIN32
  36. #if !defined( __MINGW32__ )
  37. # define WIN32_LEAN_AND_MEAN
  38. # ifndef NOMINMAX
  39. # define NOMINMAX // required to stop windows.h messing up std::min
  40. # endif
  41. #endif
  42. # include <windows.h>
  43. # include <wingdi.h>
  44. # include <GL/glew.h>
  45. # include <GL/wglew.h>
  46. # include <GL/glu.h>
  47. #elif BS_PLATFORM == BS_PLATFORM_LINUX
  48. # include <GL/glew.h>
  49. # include <GL/glu.h>
  50. # define GL_GLEXT_PROTOTYPES
  51. #elif BS_PLATFORM == BS_PLATFORM_APPLE
  52. # include <GL/glew.h>
  53. # include <OpenGL/glu.h>
  54. #endif
  55. #if BS_THREAD_SUPPORT == 1
  56. GLEWContext * glewGetContext();
  57. # if BS_PLATFORM == BS_PLATFORM_WIN32
  58. WGLEWContext * wglewGetContext();
  59. # endif
  60. #endif
  61. // Lots of generated code in here which triggers the new VC CRT security warnings
  62. #if !defined( _CRT_SECURE_NO_DEPRECATE )
  63. #define _CRT_SECURE_NO_DEPRECATE
  64. #endif
  65. #if (BS_PLATFORM == BS_PLATFORM_WIN32) && !defined(__MINGW32__) && !defined(BS_STATIC_LIB)
  66. # ifdef BS_RSGL_EXPORTS
  67. # define BS_RSGL_EXPORT __declspec(dllexport)
  68. # else
  69. # if defined( __MINGW32__ )
  70. # define BS_RSGL_EXPORT
  71. # else
  72. # define BS_RSGL_EXPORT __declspec(dllimport)
  73. # endif
  74. # endif
  75. #elif defined ( BS_GCC_VISIBILITY )
  76. # define BS_RSGL_EXPORT __attribute__ ((visibility("default")))
  77. #else
  78. # define BS_RSGL_EXPORT
  79. #endif