Plus/include/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-2013 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
Ogre::Win32GLSupport::mWglChoosePixelFormat
PFNWGLCHOOSEPIXELFORMATARBPROC mWglChoosePixelFormat
Definition: Plus/include/win32/OgreWin32GLSupport.h:94
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::Win32GLSupport::DisplayMonitorInfoIterator
DisplayMonitorInfoList::iterator DisplayMonitorInfoIterator
Definition: Plus/include/win32/OgreWin32GLSupport.h:103
OgreWin32Prerequisites.h
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::Win32GLSupport::DisplayMonitorInfoList
vector< DisplayMonitorInfo >::type DisplayMonitorInfoList
Definition: Plus/include/win32/OgreWin32GLSupport.h:102
Ogre::NameValuePairList
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Definition: OgreCommon.h:550
Ogre::vector< DEVMODE >::type
std::vector< DEVMODE, STLAllocator< DEVMODE, GeneralAllocPolicy > > type
Definition: OgrePrerequisites.h:494
OgreGL3PlusRenderSystem.h
_OgreGL3PlusExport
#define _OgreGL3PlusExport
Definition: OgreGL3PlusPrerequisites.h:91
OgreGL3PlusSupport.h
Ogre::Win32GLSupport::DisplayMonitorInfo
Definition: include/Win32/OgreWin32GLSupport.h:97
Ogre::vector
Definition: OgrePrerequisites.h:491

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15