BsGLPrerequisites.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. -----------------------------------------------------------------------------
  3. This source file is part of OGRE
  4. (Object-oriented Graphics Rendering Engine)
  5. For the latest info, see http://www.ogre3d.org/
  6. Copyright (c) 2000-2011 Torus Knot Software Ltd
  7. Permission is hereby granted, free of charge, to any person obtaining a copy
  8. of this software and associated documentation files (the "Software"), to deal
  9. in the Software without restriction, including without limitation the rights
  10. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11. copies of the Software, and to permit persons to whom the Software is
  12. furnished to do so, subject to the following conditions:
  13. The above copyright notice and this permission notice shall be included in
  14. all copies or substantial portions of the Software.
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. THE SOFTWARE.
  22. -----------------------------------------------------------------------------
  23. */
  24. #ifndef __GLPrerequisites_H__
  25. #define __GLPrerequisites_H__
  26. #include "BsCorePrerequisites.h"
  27. namespace BansheeEngine
  28. {
  29. extern String MODULE_NAME;
  30. // Forward declarations
  31. class GLSupport;
  32. class GLRenderSystem;
  33. class GLTexture;
  34. class GLVertexBuffer;
  35. class GLTextureManager;
  36. class GLSLGpuProgram;
  37. class GLContext;
  38. class GLRTTManager;
  39. class GLPixelBuffer;
  40. class GLGpuParamBlock;
  41. class GLSLGpuProgram;
  42. class GLVertexArrayObject;
  43. struct GLSLProgramPipeline;
  44. class GLSLProgramPipelineManager;
  45. typedef std::shared_ptr<GLPixelBuffer> GLPixelBufferPtr;
  46. typedef std::shared_ptr<GLGpuParamBlock> GLGpuParamBlockPtr;
  47. typedef std::shared_ptr<GLSLGpuProgram> GLSLGpuProgramPtr;
  48. enum TypeID_D3D9
  49. {
  50. TID_GL_GLSLGpuProgram = 11000
  51. };
  52. }
  53. #if BS_THREAD_SUPPORT == 1
  54. # define GLEW_MX
  55. #endif
  56. #if BS_PLATFORM == BS_PLATFORM_WIN32
  57. #if !defined( __MINGW32__ )
  58. # define WIN32_LEAN_AND_MEAN
  59. # ifndef NOMINMAX
  60. # define NOMINMAX // required to stop windows.h messing up std::min
  61. # endif
  62. #endif
  63. # include <windows.h>
  64. # include <wingdi.h>
  65. # include <GL/glew.h>
  66. # include <GL/wglew.h>
  67. # include <GL/glu.h>
  68. #elif BS_PLATFORM == BS_PLATFORM_LINUX
  69. # include <GL/glew.h>
  70. # include <GL/glu.h>
  71. # define GL_GLEXT_PROTOTYPES
  72. #elif BS_PLATFORM == BS_PLATFORM_APPLE
  73. # include <GL/glew.h>
  74. # include <OpenGL/glu.h>
  75. #endif
  76. #if BS_THREAD_SUPPORT == 1
  77. GLEWContext * glewGetContext();
  78. # if BS_PLATFORM == BS_PLATFORM_WIN32
  79. WGLEWContext * wglewGetContext();
  80. # endif
  81. #endif
  82. /// Lots of generated code in here which triggers the new VC CRT security warnings
  83. #if !defined( _CRT_SECURE_NO_DEPRECATE )
  84. #define _CRT_SECURE_NO_DEPRECATE
  85. #endif
  86. #if (BS_PLATFORM == BS_PLATFORM_WIN32) && !defined(__MINGW32__) && !defined(BS_STATIC_LIB)
  87. # ifdef BS_RSGL_EXPORTS
  88. # define BS_RSGL_EXPORT __declspec(dllexport)
  89. # else
  90. # if defined( __MINGW32__ )
  91. # define BS_RSGL_EXPORT
  92. # else
  93. # define BS_RSGL_EXPORT __declspec(dllimport)
  94. # endif
  95. # endif
  96. #elif defined ( BS_GCC_VISIBILITY )
  97. # define BS_RSGL_EXPORT __attribute__ ((visibility("default")))
  98. #else
  99. # define BS_RSGL_EXPORT
  100. #endif
  101. #endif //#ifndef __GLPrerequisites_H__