CmGLPrerequisites.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 "CmPrerequisites.h"
  27. namespace CamelotFramework {
  28. // Forward declarations
  29. class GLSupport;
  30. class GLRenderSystem;
  31. class GLTexture;
  32. class GLTextureManager;
  33. class GLSLGpuProgram;
  34. class GLContext;
  35. class GLRTTManager;
  36. class GLPixelBuffer;
  37. class GLGpuParamBlock;
  38. class GLSLGpuProgram;
  39. struct GLSLProgramPipeline;
  40. class GLSLProgramPipelineManager;
  41. typedef std::shared_ptr<GLPixelBuffer> GLPixelBufferPtr;
  42. typedef std::shared_ptr<GLGpuParamBlock> GLGpuParamBlockPtr;
  43. typedef std::shared_ptr<GLSLGpuProgram> GLSLGpuProgramPtr;
  44. enum TypeID_D3D9
  45. {
  46. TID_GL_GLSLProgram = 11000
  47. };
  48. }
  49. #if CM_THREAD_SUPPORT == 1
  50. # define GLEW_MX
  51. #endif
  52. #if CM_PLATFORM == CM_PLATFORM_WIN32
  53. #if !defined( __MINGW32__ )
  54. # define WIN32_LEAN_AND_MEAN
  55. # ifndef NOMINMAX
  56. # define NOMINMAX // required to stop windows.h messing up std::min
  57. # endif
  58. #endif
  59. # include <windows.h>
  60. # include <wingdi.h>
  61. # include <GL/glew.h>
  62. # include <GL/wglew.h>
  63. # include <GL/glu.h>
  64. #elif CM_PLATFORM == CM_PLATFORM_LINUX
  65. # include <GL/glew.h>
  66. # include <GL/glu.h>
  67. # define GL_GLEXT_PROTOTYPES
  68. #elif CM_PLATFORM == CM_PLATFORM_APPLE
  69. # include <GL/glew.h>
  70. # include <OpenGL/glu.h>
  71. #endif
  72. #if CM_THREAD_SUPPORT == 1
  73. // implemented in OgreGLContext.cpp
  74. GLEWContext * glewGetContext();
  75. # if CM_PLATFORM == CM_PLATFORM_WIN32
  76. // implemented in OgreWin32Context.cpp
  77. WGLEWContext * wglewGetContext();
  78. # endif
  79. #endif
  80. /// Lots of generated code in here which triggers the new VC CRT security warnings
  81. #if !defined( _CRT_SECURE_NO_DEPRECATE )
  82. #define _CRT_SECURE_NO_DEPRECATE
  83. #endif
  84. #if (CM_PLATFORM == CM_PLATFORM_WIN32) && !defined(__MINGW32__) && !defined(CM_STATIC_LIB)
  85. # ifdef CM_RSGL_EXPORTS
  86. # define CM_RSGL_EXPORT __declspec(dllexport)
  87. # else
  88. # if defined( __MINGW32__ )
  89. # define CM_RSGL_EXPORT
  90. # else
  91. # define CM_RSGL_EXPORT __declspec(dllimport)
  92. # endif
  93. # endif
  94. #elif defined ( CM_GCC_VISIBILITY )
  95. # define CM_RSGL_EXPORT __attribute__ ((visibility("default")))
  96. #else
  97. # define CM_RSGL_EXPORT
  98. #endif
  99. #endif //#ifndef __GLPrerequisites_H__