OGRE-Next 3.0.0
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::GLXGLSupport Class Referencefinal

#include <OgreGLXGLSupport.h>

Inheritance diagram for Ogre::GLXGLSupport:

Public Member Functions

 GLXGLSupport ()
 ~GLXGLSupport () override
void addConfig () override
 Add any special config values to the system.
GLXFBConfig * chooseFBConfig (const GLint *attribList, GLint *nElements)
 Portable replacement for glXChooseFBConfig.
::GLXContext createNewContext (GLXFBConfig fbConfig, GLint renderType, ::GLXContext shareList, GLboolean direct) const
 Portable replacement for glXCreateNewContext.
WindowcreateWindow (bool autoCreateWindow, GL3PlusRenderSystem *renderSystem, const String &windowTitle) override
String getDisplayName ()
 Get the name of the display and screen used for rendering.
GLint getFBConfigAttrib (GLXFBConfig fbConfig, GLint attribute, GLint *value)
 Portable replacement for glXGetFBConfigAttrib.
GLXFBConfig getFBConfigFromContext (::GLXContext context)
 Get the GLXFBConfig used to create a ::GLXContext.
GLXFBConfig getFBConfigFromDrawable (GLXDrawable drawable, unsigned int *width, unsigned int *height)
 Get the GLXFBConfig used to create a GLXDrawable.
GLXFBConfig getFBConfigFromVisualID (VisualID visualid)
 Gets a GLXFBConfig compatible with a VisualID.
DisplaygetGLDisplay ()
 Get the Display connection used for rendering.
void * getProcAddress (const char *procname) const override
 Get the address of a function.
XVisualInfogetVisualFromFBConfig (GLXFBConfig fbConfig)
 Portable replacement for glXGetVisualFromFBConfig.
DisplaygetXDisplay ()
 Get the Display connection used for window management & events.
void initialiseExtensions () override
 Initialises GL extensions, must be done AFTER the GL context has been established.
bool loadIcon (const String &name, Pixmap *pix, Pixmap *mask)
 Loads an icon from an Ogre resource into the X Server.
WindownewWindow (const String &name, uint32 width, uint32 height, bool fullScreen, const NameValuePairList *miscParams=0) override
 Creates a new rendering window.
GLXFBConfig selectFBConfig (const int *minAttribs, const int *maxAttribs)
 Select an FBConfig given a list of required and a list of desired properties.
void setConfigOption (const String &name, const String &value) override
void start () override
 Start anything special.
void stop () override
 Stop anything special.
void switchMode ()
 Switch back to original video mode.
void switchMode (uint32 width, uint32 height, short frequency)
 Switch video modes.
String validateConfig () override
 Make sure all the extra options are valid.
Public Member Functions inherited from Ogre::GL3PlusSupport
 GL3PlusSupport ()
virtual ~GL3PlusSupport ()
virtual bool checkExtension (const String &ext) const
 Check if an extension is available.
virtual ConfigOptionMapgetConfigOptions ()
virtual unsigned int getDisplayMonitorCount () const
 Gets the number of display monitors.
const StringgetGLVendor () const
 Get vendor information.
const DriverVersiongetGLVersion () const
 Get version information.
virtual size_t getNumPriorityConfigOptions () const
virtual const char * getPriorityConfigOption (size_t idx) const
const StringgetShaderCachePath () const
 Get shader cache path.
const StringgetShaderLibraryPath () const
 Get shader library path.
bool hasMinGLVersion (int major, int minor) const
 Check if GL Version is supported.
void setShaderCachePath (String path)
 Set shader cache path.
void setShaderLibraryPath (String path)
 Set shader library path.

Public Attributes

Atom mAtomDeleteWindow
Atom mAtomFullScreen
Atom mAtomState

Constructor & Destructor Documentation

◆ GLXGLSupport()

Ogre::GLXGLSupport::GLXGLSupport ( )

◆ ~GLXGLSupport()

Ogre::GLXGLSupport::~GLXGLSupport ( )
override

Member Function Documentation

◆ addConfig()

void Ogre::GLXGLSupport::addConfig ( )
overridevirtual

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 wxh

Implements Ogre::GL3PlusSupport.

◆ chooseFBConfig()

GLXFBConfig * Ogre::GLXGLSupport::chooseFBConfig ( const GLint * attribList,
GLint * nElements )

Portable replacement for glXChooseFBConfig.

◆ createNewContext()

::GLXContext Ogre::GLXGLSupport::createNewContext ( GLXFBConfig fbConfig,
GLint renderType,
::GLXContext shareList,
GLboolean direct ) const

Portable replacement for glXCreateNewContext.

◆ createWindow()

Window * Ogre::GLXGLSupport::createWindow ( bool autoCreateWindow,
GL3PlusRenderSystem * renderSystem,
const String & windowTitle )
overridevirtual

Implements Ogre::GL3PlusSupport.

◆ getDisplayName()

String Ogre::GLXGLSupport::getDisplayName ( )

Get the name of the display and screen used for rendering.

Ogre normally opens its own connection to the X server and renders onto the screen where the user logged in

However, if Ogre is passed a current GL context when the first RenderTarget is created, then it will connect to the X server using the same connection as that GL context and direct all subsequent rendering to the screen targeted by that GL context.

Returns
Display name.

◆ getFBConfigAttrib()

GLint Ogre::GLXGLSupport::getFBConfigAttrib ( GLXFBConfig fbConfig,
GLint attribute,
GLint * value )

Portable replacement for glXGetFBConfigAttrib.

◆ getFBConfigFromContext()

GLXFBConfig Ogre::GLXGLSupport::getFBConfigFromContext ( ::GLXContext context)

Get the GLXFBConfig used to create a ::GLXContext.

Parameters
drawableGLXContext
Returns
GLXFBConfig used to create the context

◆ getFBConfigFromDrawable()

GLXFBConfig Ogre::GLXGLSupport::getFBConfigFromDrawable ( GLXDrawable drawable,
unsigned int * width,
unsigned int * height )

Get the GLXFBConfig used to create a GLXDrawable.

Caveat: GLX version 1.3 is needed when the drawable is a GLXPixmap

Parameters
drawableGLXDrawable
widthReceiver for the drawable width
heightReceiver for the drawable height
Returns
GLXFBConfig used to create the drawable

◆ getFBConfigFromVisualID()

GLXFBConfig Ogre::GLXGLSupport::getFBConfigFromVisualID ( VisualID visualid)

Gets a GLXFBConfig compatible with a VisualID.

Some platforms fail to implement glXGetFBconfigFromVisualSGIX as part of the GLX_SGIX_fbconfig extension, but this portable alternative suffices for the creation of compatible contexts.

Parameters
visualidVisualID
Returns
FBConfig for VisualID

◆ getGLDisplay()

Display * Ogre::GLXGLSupport::getGLDisplay ( )

Get the Display connection used for rendering.

This function establishes the initial connection when necessary.

Returns
Display connection

◆ getProcAddress()

void * Ogre::GLXGLSupport::getProcAddress ( const char * procname) const
overridevirtual

Get the address of a function.

Implements Ogre::GL3PlusSupport.

◆ getVisualFromFBConfig()

XVisualInfo * Ogre::GLXGLSupport::getVisualFromFBConfig ( GLXFBConfig fbConfig)

Portable replacement for glXGetVisualFromFBConfig.

◆ getXDisplay()

Display * Ogre::GLXGLSupport::getXDisplay ( )

Get the Display connection used for window management & events.

Returns
Display connection

◆ initialiseExtensions()

void Ogre::GLXGLSupport::initialiseExtensions ( )
overridevirtual

Initialises GL extensions, must be done AFTER the GL context has been established.

Reimplemented from Ogre::GL3PlusSupport.

◆ loadIcon()

bool Ogre::GLXGLSupport::loadIcon ( const String & name,
Pixmap * pix,
Pixmap * mask )

Loads an icon from an Ogre resource into the X Server.

This currently only works for 24 and 32 bit displays. The image must be findable by the Ogre resource system, and of format PF_A8R8G8B8.

Parameters
displayX display
nameName of image to load
pixReceiver for the output pixmap
maskReceiver for the output mask (alpha bitmap)
Returns
true on success

◆ newWindow()

Window * Ogre::GLXGLSupport::newWindow ( const String & name,
uint32 width,
uint32 height,
bool fullScreen,
const NameValuePairList * miscParams = 0 )
overridevirtual

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:
KeyType/ValuesDefaultDescriptionNotes
titleAny stringRenderTarget nameThe title of the window that will appear in the title bar 
colourDepth16, 32Desktop depthColour depth of the resulting rendering window; only applies if fullScreenWin32 Specific
leftPositive integersCentredScreen x coordinate from left 
topPositive integersCentredScreen y coordinate from left 
depthBuffertrue, falsetrueUse depth bufferDirectX9 specific
externalWindowHandleWin32: HWND as integer
GLX: poslong:posint:poslong (display*:screen:windowHandle) or poslong:posint:poslong:poslong (display*:screen:windowHandle:XVisualInfo*)
OS X Cocoa: OgreGLView address as an integer. You can pass NSView or NSWindow too, but should perform OgreGLView callbacks into the Ogre manually. iOS: UIWindow address as an integer
0 (none)External window handle, for embedding the OGRE render in an existing window 
externalGLControltrue, falsefalseLet 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
externalGLContextContext as Unsigned Long0 (create own context)Use an externally created GL contextOpenGL Specific
parentWindowHandleWin32: 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 
contentScalingFactorPositive Float greater than 1.0The default content scaling factor of the screenSpecifies 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. iOS Specific 
externalViewHandleUIView pointer as an integer0External view handle, for rendering OGRE render in an existing viewiOS Specific 
externalViewControllerHandleUIViewController pointer as an integer0External view controller handle, for embedding OGRE in an existing view controlleriOS Specific 
externalSharegroupEAGLSharegroup pointer as an integer0External sharegroup, used to shared GL resources between contextsiOS Specific 
Full Screentrue, falsefalseSpecify whether to create the window in full screen modeOS X Specific 
MSAAPositive integer (usually 1, 2, 4, 8, 16)1Multisample antialiasing factor 
MSAA_QualityDepends on RenderSystem and hardware. Currently supports:
0 ... infinite number (depends on HW)
BlankFull screen antialiasing hint 
displayFrequencyRefresh rate in Hertz (e.g. 60, 75, 100)Desktop vsync rateDisplay frequency rate, for fullscreen mode 
vsynctrue, falsefalseSynchronize buffer swaps to monitor vsync, eliminating tearing at the expense of a fixed frame rate 
vsyncInterval1, 2, 3, 41If 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. 
bordernone, fixed, resizeresizeThe type of window border (in windowed mode) 
outerDimensionstrue, falsefalseWhether the width/height is expressed as the size of the outer window, rather than the content area 
useNVPerfHUDtrue, falsefalseEnable the use of nVidia NVPerfHUD 
gammatrue, falsefalseEnable hardware conversion from linear colour space to gamma colour space on rendering to the window. 
enableDoubleClicktrue, falsefalseEnable the window to keep track and transmit double click messages.Win32 Specific
MSAAPositive integer (usually 0, 2, 4, 8, 16)0Full screen antialiasing factorAndroid Specific
CSAAPositive integer (usually 0, 2, 4, 8, 16)0Coverage sampling factor (https://www.khronos.org/registry/egl/extensions/NV/EGL_NV_coverage_sample.txt)Android Specific
maxColourBufferSizePositive integer (usually 16, 32)32Max EGL_BUFFER_SIZEAndroid Specific
minColourBufferSizePositive integer (usually 16, 32)16Min EGL_BUFFER_SIZEAndroid Specific
maxStencilBufferSizePositive integer (usually 0, 8)0EGL_STENCIL_SIZEAndroid Specific
maxDepthBufferSizePositive integer (usually 0, 16, 24)16EGL_DEPTH_SIZEAndroid Specific
"/startdir/src/ogre-next-3.0.0/RenderSystems/GL3Plus/include/windowing/GLX/OgreGLXGLSupport.h"

Implements Ogre::GL3PlusSupport.

◆ selectFBConfig()

GLXFBConfig Ogre::GLXGLSupport::selectFBConfig ( const int * minAttribs,
const int * maxAttribs )

Select an FBConfig given a list of required and a list of desired properties.

Parameters
minAttribsFBConfig attributes that must be provided with minimum values
maxAttribsFBConfig attributes that are desirable with maximum values
Returns
GLXFBConfig with attributes or 0 when unsupported.

◆ setConfigOption()

void Ogre::GLXGLSupport::setConfigOption ( const String & name,
const String & value )
overridevirtual

Reimplemented from Ogre::GL3PlusSupport.

◆ start()

void Ogre::GLXGLSupport::start ( )
overridevirtual

Start anything special.

Implements Ogre::GL3PlusSupport.

◆ stop()

void Ogre::GLXGLSupport::stop ( )
overridevirtual

Stop anything special.

Implements Ogre::GL3PlusSupport.

◆ switchMode() [1/2]

void Ogre::GLXGLSupport::switchMode ( )

Switch back to original video mode.

◆ switchMode() [2/2]

void Ogre::GLXGLSupport::switchMode ( uint32 width,
uint32 height,
short frequency )

Switch video modes.

Parameters
widthReceiver for requested and final width
heightReceiver for requested and final drawable height
heightReceiver for requested and final drawable frequency

◆ validateConfig()

String Ogre::GLXGLSupport::validateConfig ( )
overridevirtual

Make sure all the extra options are valid.

Returns
string with error message

Implements Ogre::GL3PlusSupport.

Member Data Documentation

◆ mAtomDeleteWindow

Atom Ogre::GLXGLSupport::mAtomDeleteWindow

◆ mAtomFullScreen

Atom Ogre::GLXGLSupport::mAtomFullScreen

◆ mAtomState

Atom Ogre::GLXGLSupport::mAtomState

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