OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Ogre::Win32GLSupport Class Reference

#include <OgreWin32GLSupport.h>

+ Inheritance diagram for Ogre::Win32GLSupport:
+ Collaboration diagram for Ogre::Win32GLSupport:

Classes

struct  DisplayMonitorInfo
 

Public Member Functions

 Win32GLSupport ()
 
void addConfig ()
 Add any special config values to the system. More...
 
virtual bool checkExtension (const String &ext) const
 Check if an extension is available. More...
 
bool checkMinGLVersion (const String &v) const
 Compare GL version numbers. More...
 
virtual GLPBuffercreatePBuffer (PixelComponentType format, size_t width, size_t height)
 
virtual RenderWindowcreateWindow (bool autoCreateWindow, GLRenderSystem *renderSystem, const String &windowTitle="OGRE Render Window")
 
virtual ConfigOptionMapgetConfigOptions (void)
 
virtual unsigned int getDisplayMonitorCount () const
 Gets the number of display monitors. More...
 
const StringgetGLVendor (void) const
 Get vendor information. More...
 
const StringgetGLVersion (void) const
 Get version information. More...
 
void * getProcAddress (const String &procname)
 Get the address of a function. More...
 
virtual void initialiseExtensions ()
 Initialise extensions. More...
 
virtual RenderWindownewWindow (const String &name, unsigned int width, unsigned int height, bool fullScreen, const NameValuePairList *miscParams=0)
 Creates a new rendering window. More...
 
bool selectPixelFormat (HDC hdc, int colourDepth, int multisample, bool hwGamma)
 
void setConfigOption (const String &name, const String &value)
 
void start ()
 Start anything special. More...
 
void stop ()
 Stop anything special. More...
 
virtual bool supportsPBuffers ()
 
String validateConfig ()
 Make sure all the extra options are valid. More...
 

Protected Attributes

set< String >::type extensionList
 
ConfigOptionMap mOptions
 

Private Types

typedef
DisplayMonitorInfoList::iterator 
DisplayMonitorInfoIterator
 
typedef vector
< DisplayMonitorInfo >::type 
DisplayMonitorInfoList
 

Private Member Functions

void initialiseWGL ()
 
void refreshConfig ()
 

Static Private Member Functions

static LRESULT CALLBACK dummyWndProc (HWND hwnd, UINT umsg, WPARAM wp, LPARAM lp)
 
static BOOL CALLBACK sCreateMonitorsInfoEnumProc (HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
 

Private Attributes

vector< DEVMODE >::type mDevModes
 
vector< int >::type mFSAALevels
 
bool mHasHardwareGamma
 
bool mHasMultisample
 
bool mHasPixelFormatARB
 
Win32WindowmInitialWindow
 
DisplayMonitorInfoList mMonitorInfoList
 

Detailed Description

Definition at line 11 of file OgreWin32GLSupport.h.

Member Typedef Documentation

typedef DisplayMonitorInfoList::iterator Ogre::Win32GLSupport::DisplayMonitorInfoIterator
private

Definition at line 77 of file OgreWin32GLSupport.h.

Constructor & Destructor Documentation

Ogre::Win32GLSupport::Win32GLSupport ( )

Member Function Documentation

void Ogre::Win32GLSupport::addConfig ( )
virtual

Add any special config values to the system.

Must have a "Full Screen" value that is a bool and a "Video Mode" value that is a string in the form of wxhxb

Implements Ogre::GLSupport.

virtual bool Ogre::GLSupport::checkExtension ( const String ext) const
virtualinherited

Check if an extension is available.

Reimplemented in Ogre::GTKGLSupport.

bool Ogre::GLSupport::checkMinGLVersion ( const String v) const
inherited

Compare GL version numbers.

virtual GLPBuffer* Ogre::Win32GLSupport::createPBuffer ( PixelComponentType  format,
size_t  width,
size_t  height 
)
virtual

Reimplemented from Ogre::GLSupport.

virtual RenderWindow* Ogre::Win32GLSupport::createWindow ( bool  autoCreateWindow,
GLRenderSystem renderSystem,
const String windowTitle = "OGRE Render Window" 
)
virtual

Implements Ogre::GLSupport.

static LRESULT CALLBACK Ogre::Win32GLSupport::dummyWndProc ( HWND  hwnd,
UINT  umsg,
WPARAM  wp,
LPARAM  lp 
)
staticprivate
virtual ConfigOptionMap& Ogre::GLSupport::getConfigOptions ( void  )
virtualinherited
virtual unsigned int Ogre::Win32GLSupport::getDisplayMonitorCount ( ) const
virtual

Gets the number of display monitors.

See also
Root::getDisplayMonitorCount

Reimplemented from Ogre::GLSupport.

const String& Ogre::GLSupport::getGLVendor ( void  ) const
inlineinherited

Get vendor information.

Definition at line 85 of file OgreGLSupport.h.

const String& Ogre::GLSupport::getGLVersion ( void  ) const
inlineinherited

Get version information.

Definition at line 93 of file OgreGLSupport.h.

void* Ogre::Win32GLSupport::getProcAddress ( const String procname)
virtual

Get the address of a function.

Implements Ogre::GLSupport.

virtual void Ogre::Win32GLSupport::initialiseExtensions ( )
virtual

Initialise extensions.

Reimplemented from Ogre::GLSupport.

void Ogre::Win32GLSupport::initialiseWGL ( )
private
virtual RenderWindow* Ogre::Win32GLSupport::newWindow ( const String name,
unsigned int  width,
unsigned int  height,
bool  fullScreen,
const NameValuePairList miscParams = 0 
)
virtual

Creates a new rendering window.

Remarks
This method creates a new rendering window as specified by the paramteters. The rendering system could be responible for only a single window (e.g. in the case of a game), or could be in charge of multiple ones (in the case of a level editor). The option to create the window as a child of another is therefore given. This method will create an appropriate subclass of RenderWindow depending on the API and platform implementation.
After creation, this window can be retrieved using getRenderTarget().
Parameters
nameThe name of the window. Used in other methods later like setRenderTarget and getRenderTarget.
widthThe width of the new window.
heightThe height of the new window.
fullScreenSpecify true to make the window full screen without borders, title bar or menu bar.
miscParamsA NameValuePairList describing the other parameters for the new rendering window. Options are case sensitive. Unrecognised parameters will be ignored silently. These values might be platform dependent, but these are present for all platforms unless indicated otherwise:
Key Type/Values Default Description Notes
title Any string RenderTarget name The title of the window that will appear in the title bar  
colourDepth 16, 32 Desktop depth Colour depth of the resulting rendering window; only applies if fullScreen Win32 Specific
left Positive integers Centred Screen x coordinate from left  
top Positive integers Centred Screen y coordinate from left  
depthBuffer true, false true Use depth buffer DirectX9 specific
externalWindowHandle Win32: HWND as integer
GLX: poslong:posint:poslong (display*:screen:windowHandle) or poslong:posint:poslong:poslong (display*:screen:windowHandle:XVisualInfo*)
0 (none) External window handle, for embedding the OGRE render in an existing window  
externalGLControl true, false false Let the external window control OpenGL i.e. don't select a pixel format for the window, do not change v-sync and do not swap buffer. When set to true, the calling application is responsible of OpenGL initialization and buffer swapping. It should also create an OpenGL context for its own rendering, Ogre will create one for its use. Then the calling application must also enable Ogre OpenGL context before calling any Ogre function and restore its OpenGL context after these calls. OpenGL specific
externalGLContext Context as Unsigned Long 0 (create own context) Use an externally created GL context OpenGL Specific
parentWindowHandle Win32: HWND as integer
GLX: poslong:posint:poslong (display*:screen:windowHandle) or poslong:posint:poslong:poslong (display*:screen:windowHandle:XVisualInfo*)
0 (none) Parent window handle, for embedding the OGRE in a child of an external window  
macAPI String: "cocoa" or "carbon" "carbon" Specifies the type of rendering window on the Mac Platform.  
macAPICocoaUseNSView bool "true" or "false" "false" On the Mac platform the most diffused method to embed OGRE in a custom application is to use Interface Builder and add to the interface an instance of OgreView. The pointer to this instance is then used as "externalWindowHandle". However, there are cases where you are NOT using Interface Builder and you get the Cocoa NSView* of an existing interface. For example, this is happens when you want to render into a Java/AWT interface. In short, by setting this flag to "true" the Ogre::Root::createRenderWindow interprets the "externalWindowHandle" as a NSView* instead of an OgreView*. See OgreOSXCocoaView.h/mm.  
contentScalingFactor Positive Float greater than 1.0 The default content scaling factor of the screen Specifies the CAEAGLLayer content scaling factor. Only supported on iOS 4 or greater. This can be useful to limit the resolution of the OpenGL ES backing store. For example, the iPhone 4's native resolution is 960 x 640. Windows are always 320 x 480, if you would like to limit the display to 720 x 480, specify 1.5 as the scaling factor.  
FSAA Positive integer (usually 0, 2, 4, 8, 16) 0 Full screen antialiasing factor  
FSAAHint Depends on RenderSystem and hardware. Currently supports:
"Quality": on systems that have an option to prefer higher AA quality over speed, use it
Blank Full screen antialiasing hint  
displayFrequency Refresh rate in Hertz (e.g. 60, 75, 100) Desktop vsync rate Display frequency rate, for fullscreen mode  
vsync true, false false Synchronize buffer swaps to monitor vsync, eliminating tearing at the expense of a fixed frame rate  
vsyncInterval 1, 2, 3, 4 1 If vsync is enabled, the minimum number of vertical blanks that should occur between renders. For example if vsync is enabled, the refresh rate is 60 and this is set to 2, then the frame rate will be locked at 30.  
border none, fixed, resize resize The type of window border (in windowed mode)  
outerDimensions true, false false Whether the width/height is expressed as the size of the outer window, rather than the content area  
useNVPerfHUD true, false false Enable the use of nVidia NVPerfHUD  
gamma true, false false Enable hardware conversion from linear colour space to gamma colour space on rendering to the window.  

Implements Ogre::GLSupport.

void Ogre::Win32GLSupport::refreshConfig ( )
private
static BOOL CALLBACK Ogre::Win32GLSupport::sCreateMonitorsInfoEnumProc ( HMONITOR  hMonitor,
HDC  hdcMonitor,
LPRECT  lprcMonitor,
LPARAM  dwData 
)
staticprivate
bool Ogre::Win32GLSupport::selectPixelFormat ( HDC  hdc,
int  colourDepth,
int  multisample,
bool  hwGamma 
)
void Ogre::Win32GLSupport::setConfigOption ( const String name,
const String value 
)
virtual

Reimplemented from Ogre::GLSupport.

void Ogre::Win32GLSupport::start ( )
virtual

Start anything special.

Implements Ogre::GLSupport.

void Ogre::Win32GLSupport::stop ( )
virtual

Stop anything special.

Implements Ogre::GLSupport.

virtual bool Ogre::Win32GLSupport::supportsPBuffers ( )
virtual

Reimplemented from Ogre::GLSupport.

String Ogre::Win32GLSupport::validateConfig ( )
virtual

Make sure all the extra options are valid.

Implements Ogre::GLSupport.

Member Data Documentation

set<String>::type Ogre::GLSupport::extensionList
protectedinherited

Definition at line 128 of file OgreGLSupport.h.

vector<DEVMODE>::type Ogre::Win32GLSupport::mDevModes
private

Definition at line 63 of file OgreWin32GLSupport.h.

vector<int>::type Ogre::Win32GLSupport::mFSAALevels
private

Definition at line 65 of file OgreWin32GLSupport.h.

bool Ogre::Win32GLSupport::mHasHardwareGamma
private

Definition at line 68 of file OgreWin32GLSupport.h.

bool Ogre::Win32GLSupport::mHasMultisample
private

Definition at line 67 of file OgreWin32GLSupport.h.

bool Ogre::Win32GLSupport::mHasPixelFormatARB
private

Definition at line 66 of file OgreWin32GLSupport.h.

Win32Window* Ogre::Win32GLSupport::mInitialWindow
private

Definition at line 64 of file OgreWin32GLSupport.h.

DisplayMonitorInfoList Ogre::Win32GLSupport::mMonitorInfoList
private

Definition at line 79 of file OgreWin32GLSupport.h.

ConfigOptionMap Ogre::GLSupport::mOptions
protectedinherited

Definition at line 125 of file OgreGLSupport.h.


The documentation for this class was generated from the following file: