OgreD3D9VideoMode.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 __D3D9VIDEOMODE_H__
29 #define __D3D9VIDEOMODE_H__
30 
31 #include "OgreD3D9Prerequisites.h"
32 #include "OgreString.h"
33 
34 namespace Ogre
35 {
36  static unsigned int modeCount = 0;
37 
39  {
40  private:
41  D3DDISPLAYMODE mDisplayMode;
42  unsigned int modeNumber;
43 
44  public:
45  D3D9VideoMode() { modeNumber = ++modeCount; ZeroMemory( &mDisplayMode, sizeof(D3DDISPLAYMODE) ); }
46  D3D9VideoMode( const D3D9VideoMode &ob ) { modeNumber = ++modeCount; mDisplayMode = ob.mDisplayMode; }
47  D3D9VideoMode( D3DDISPLAYMODE d3ddm ) { modeNumber = ++modeCount; mDisplayMode = d3ddm; }
49  {
50  modeCount--;
51  }
52 
53  unsigned int getWidth() const { return mDisplayMode.Width; }
54  unsigned int getHeight() const { return mDisplayMode.Height; }
55  D3DFORMAT getFormat() const { return mDisplayMode.Format; }
56  unsigned int getRefreshRate() const { return mDisplayMode.RefreshRate; }
57  unsigned int getColourDepth() const;
58  D3DDISPLAYMODE getDisplayMode() const { return mDisplayMode; }
59  void increaseRefreshRate(unsigned int rr) { mDisplayMode.RefreshRate = rr; }
60  String getDescription() const;
61  };
62 }
63 #endif
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::D3D9VideoMode::~D3D9VideoMode
~D3D9VideoMode()
Definition: OgreD3D9VideoMode.h:48
OgreD3D9Prerequisites.h
Ogre::D3D9VideoMode::D3D9VideoMode
D3D9VideoMode()
Definition: OgreD3D9VideoMode.h:45
Ogre::D3D9VideoMode::getWidth
unsigned int getWidth() const
Definition: OgreD3D9VideoMode.h:53
Ogre::D3D9VideoMode
Definition: OgreD3D9VideoMode.h:38
Ogre::D3D9VideoMode::getFormat
D3DFORMAT getFormat() const
Definition: OgreD3D9VideoMode.h:55
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::D3D9VideoMode::increaseRefreshRate
void increaseRefreshRate(unsigned int rr)
Definition: OgreD3D9VideoMode.h:59
Ogre::D3D9VideoMode::D3D9VideoMode
D3D9VideoMode(const D3D9VideoMode &ob)
Definition: OgreD3D9VideoMode.h:46
Ogre::modeCount
static unsigned int modeCount
Definition: OgreD3D11VideoMode.h:35
Ogre::D3D9VideoMode::getDisplayMode
D3DDISPLAYMODE getDisplayMode() const
Definition: OgreD3D9VideoMode.h:58
Ogre::D3D9VideoMode::mDisplayMode
D3DDISPLAYMODE mDisplayMode
Definition: OgreD3D9VideoMode.h:41
Ogre::D3D9VideoMode::getRefreshRate
unsigned int getRefreshRate() const
Definition: OgreD3D9VideoMode.h:56
_OgreD3D9Export
#define _OgreD3D9Export
Definition: OgreD3D9Prerequisites.h:118
Ogre::D3D9VideoMode::getHeight
unsigned int getHeight() const
Definition: OgreD3D9VideoMode.h:54
OgreString.h
Ogre::D3D9VideoMode::D3D9VideoMode
D3D9VideoMode(D3DDISPLAYMODE d3ddm)
Definition: OgreD3D9VideoMode.h:47
Ogre::D3D9VideoMode::modeNumber
unsigned int modeNumber
Definition: OgreD3D9VideoMode.h:42

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