CmOSXGLSupport.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. #pragma once
  25. #include "CmGLSupport.h"
  26. namespace CamelotEngine
  27. {
  28. class OSXGLSupport : public GLSupport
  29. {
  30. public:
  31. OSXGLSupport();
  32. ~OSXGLSupport();
  33. /**
  34. * Add any special config values to the system.
  35. * Must have a "Full Screen" value that is a bool and a "Video Mode" value
  36. * that is a string in the form of wxh
  37. */
  38. void addConfig( void );
  39. /**
  40. * Make sure all the extra options are valid
  41. */
  42. String validateConfig( void );
  43. /// @copydoc GLSupport::createWindow
  44. RenderWindow* createWindow( bool autoCreateWindow, GLRenderSystem* renderSystem, const String& windowTitle );
  45. /// @copydoc RenderSystem::createRenderWindow
  46. virtual RenderWindow* newWindow( const String &name, unsigned int width, unsigned int height,
  47. bool fullScreen, const NameValuePairList *miscParams = 0 );
  48. /**
  49. * Start anything special
  50. */
  51. void start();
  52. /**
  53. * Stop anything special
  54. */
  55. void stop();
  56. /**
  57. * Get the address of a function
  58. */
  59. void* getProcAddress( const char *name );
  60. void* getProcAddress( const String& procname );
  61. virtual bool supportsPBuffers();
  62. virtual GLPBuffer* createPBuffer( PixelComponentType format, size_t width, size_t height );
  63. // Core Foundation Array callback function for sorting, must be static for the function ptr
  64. static CFComparisonResult _compareModes (const void *val1, const void *val2, void *context);
  65. // Core Fondation Dictionary helper functions, also static for ease of use in above static
  66. static Boolean _getDictionaryBoolean(CFDictionaryRef dict, const void* key);
  67. static long _getDictionaryLong(CFDictionaryRef dict, const void* key);
  68. protected:
  69. String mAPI;
  70. String mContextType;
  71. }; // class OSXGLSupport
  72. }; // namespace Ogre