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