OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Plus/include/windowing/win32/OgreWin32GLSupport.h
Go to the documentation of this file.
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 
7  Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9  Permission is hereby granted, free of charge, to any person obtaining a copy
10  of this software and associated documentation files (the "Software"), to deal
11  in the Software without restriction, including without limitation the rights
12  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13  copies of the Software, and to permit persons to whom the Software is
14  furnished to do so, subject to the following conditions:
15 
16  The above copyright notice and this permission notice shall be included in
17  all copies or substantial portions of the Software.
18 
19  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25  THE SOFTWARE.
26  -----------------------------------------------------------------------------
27  */
28 #ifndef __OgreWin32GLSupport_H__
29 #define __OgreWin32GLSupport_H__
30 
31 #include "OgreWin32Prerequisites.h"
32 #include "OgreGL3PlusSupport.h"
34 
35 namespace Ogre
36 {
37 
38  class _OgreGL3PlusExport Win32GLSupport : public GL3PlusSupport
39  {
40  public:
41  Win32GLSupport();
47  void addConfig();
48 
49  void setConfigOption(const String &name, const String &value);
50 
54  String validateConfig();
55 
56  virtual RenderWindow* createWindow(bool autoCreateWindow, GL3PlusRenderSystem* renderSystem, const String& windowTitle = "OGRE Render Window");
57 
59  virtual RenderWindow* newWindow(const String &name, unsigned int width, unsigned int height,
60  bool fullScreen, const NameValuePairList *miscParams = 0);
61 
62 
66  void start();
70  void stop();
71 
75  void* getProcAddress(const String& procname);
76 
80  virtual void initialiseExtensions();
81 
82 
83  bool selectPixelFormat(HDC hdc, int colourDepth, int multisample, bool hwGamma);
84 
85  virtual unsigned int getDisplayMonitorCount() const;
86  private:
87  // Allowed video modes
88  vector<DEVMODE>::type mDevModes;
89  Win32Window *mInitialWindow;
90  vector<int>::type mFSAALevels;
91  bool mHasPixelFormatARB;
92  bool mHasMultisample;
93  bool mHasHardwareGamma;
94  PFNWGLCHOOSEPIXELFORMATARBPROC mWglChoosePixelFormat;
95 
96  struct DisplayMonitorInfo
97  {
98  HMONITOR hMonitor;
99  MONITORINFOEX monitorInfoEx;
100  };
101 
103  typedef DisplayMonitorInfoList::iterator DisplayMonitorInfoIterator;
104 
105  DisplayMonitorInfoList mMonitorInfoList;
106 
107  void refreshConfig();
108  void initialiseWGL();
109  static LRESULT CALLBACK dummyWndProc(HWND hwnd, UINT umsg, WPARAM wp, LPARAM lp);
110  static BOOL CALLBACK sCreateMonitorsInfoEnumProc(HMONITOR hMonitor, HDC hdcMonitor,
111  LPRECT lprcMonitor, LPARAM dwData);
112  };
113 
114 }
115 
116 #endif
PFNWGLCHOOSEPIXELFORMATARBPROC mWglChoosePixelFormat
std::vector< DEVMODE, A > type
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition: OgreCommon.h:580
DisplayMonitorInfoList::iterator DisplayMonitorInfoIterator
#define _OgreGL3PlusExport
vector< DisplayMonitorInfo >::type DisplayMonitorInfoList
_StringBase String
Definition: OgreCommon.h:53