CmWin32GLSupport.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef __OgreWin32GLSupport_H__
  2. #define __OgreWin32GLSupport_H__
  3. #include "CmWin32Prerequisites.h"
  4. #include "CmGLSupport.h"
  5. #include "CmGLRenderSystem.h"
  6. namespace CamelotEngine
  7. {
  8. class _OgreGLExport Win32GLSupport : public GLSupport
  9. {
  10. public:
  11. Win32GLSupport();
  12. /**
  13. * Add any special config values to the system.
  14. * Must have a "Full Screen" value that is a bool and a "Video Mode" value
  15. * that is a string in the form of wxhxb
  16. */
  17. void addConfig();
  18. void setConfigOption(const String &name, const String &value);
  19. /**
  20. * Make sure all the extra options are valid
  21. */
  22. String validateConfig();
  23. virtual RenderWindow* createWindow(bool autoCreateWindow, GLRenderSystem* renderSystem, const String& windowTitle = "OGRE Render Window");
  24. /// @copydoc RenderSystem::_createRenderWindow
  25. virtual RenderWindow* newWindow(const String &name, unsigned int width, unsigned int height,
  26. bool fullScreen, const NameValuePairList *miscParams = 0);
  27. /**
  28. * Start anything special
  29. */
  30. void start();
  31. /**
  32. * Stop anything special
  33. */
  34. void stop();
  35. /**
  36. * Get the address of a function
  37. */
  38. void* getProcAddress(const String& procname);
  39. /**
  40. * Initialise extensions
  41. */
  42. virtual void initialiseExtensions();
  43. bool selectPixelFormat(HDC hdc, int colourDepth, int multisample, bool hwGamma);
  44. virtual bool supportsPBuffers();
  45. virtual GLPBuffer *createPBuffer(PixelComponentType format, size_t width, size_t height);
  46. virtual unsigned int getDisplayMonitorCount() const;
  47. private:
  48. // Allowed video modes
  49. vector<DEVMODE>::type mDevModes;
  50. Win32Window *mInitialWindow;
  51. vector<int>::type mFSAALevels;
  52. bool mHasPixelFormatARB;
  53. bool mHasMultisample;
  54. bool mHasHardwareGamma;
  55. struct DisplayMonitorInfo
  56. {
  57. HMONITOR hMonitor;
  58. MONITORINFOEX monitorInfoEx;
  59. };
  60. typedef vector<DisplayMonitorInfo>::type DisplayMonitorInfoList;
  61. typedef DisplayMonitorInfoList::iterator DisplayMonitorInfoIterator;
  62. DisplayMonitorInfoList mMonitorInfoList;
  63. void refreshConfig();
  64. void initialiseWGL();
  65. static LRESULT CALLBACK dummyWndProc(HWND hwnd, UINT umsg, WPARAM wp, LPARAM lp);
  66. static BOOL CALLBACK sCreateMonitorsInfoEnumProc(HMONITOR hMonitor, HDC hdcMonitor,
  67. LPRECT lprcMonitor, LPARAM dwData);
  68. };
  69. }
  70. #endif