BsGLPrerequisites.h 2.3 KB

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