CmGLSupport.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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 OGRE_GLSUPPORT_H
  25. #define OGRE_GLSUPPORT_H
  26. #include "CmGLPrerequisites.h"
  27. #include "CmGLRenderSystem.h"
  28. #include "CmRenderWindow.h"
  29. namespace CamelotFramework
  30. {
  31. class CM_RSGL_EXPORT GLSupport
  32. {
  33. public:
  34. GLSupport() { }
  35. virtual ~GLSupport() { }
  36. virtual RenderWindowPtr newWindow(RENDER_WINDOW_DESC& desc, RenderWindowPtr parentWindow) = 0;
  37. virtual bool supportsPBuffers();
  38. /**
  39. * Start anything special
  40. */
  41. virtual void start() = 0;
  42. /**
  43. * Stop anything special
  44. */
  45. virtual void stop() = 0;
  46. /**
  47. * Get vendor information
  48. */
  49. const String& getGLVendor(void) const
  50. {
  51. return mVendor;
  52. }
  53. /**
  54. * Get version information
  55. */
  56. const String& getGLVersion(void) const
  57. {
  58. return mVersion;
  59. }
  60. /**
  61. * Compare GL version numbers
  62. */
  63. bool checkMinGLVersion(const String& v) const;
  64. /**
  65. * Check if an extension is available
  66. */
  67. virtual bool checkExtension(const String& ext) const;
  68. /**
  69. * Get the address of a function
  70. */
  71. virtual void* getProcAddress(const String& procname) = 0;
  72. /** Initialises GL extensions, must be done AFTER the GL context has been
  73. established.
  74. */
  75. virtual void initialiseExtensions();
  76. /// @copydoc RenderSystem::getDisplayMonitorCount
  77. virtual unsigned int getDisplayMonitorCount() const
  78. {
  79. return 1;
  80. }
  81. protected:
  82. // This contains the complete list of supported extensions
  83. Set<String>::type extensionList;
  84. private:
  85. String mVersion;
  86. String mVendor;
  87. }; // class GLSupport
  88. }; // namespace CamelotFramework
  89. #endif