MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLOpenGLSurfaceCreationParameters Class Reference

Detailed Description

This class defines options that affect the creation of the OpenGL context by the drawing surface.

Public Member Functions

 TSLOpenGLSurfaceCreationParameters ()
 
 ~TSLOpenGLSurfaceCreationParameters ()
 
bool createCoreProfile () const
 
void createCoreProfile (bool coreProfile)
 
bool enableDoubleBuffering () const
 
void enableDoubleBuffering (bool doubleBuffer)
 
bool forceFallbackRenderer () const
 
void forceFallbackRenderer (bool force)
 
int numMultisampleSamples () const
 
void numMultisampleSamples (int numSamples)
 
void shareContext (HGLRC context)
 
HGLRC shareContext () const
 
bool swapBuffersManually () const
 
void swapBuffersManually (bool swap)
 
bool useVSync () const
 
void useVSync (bool enable)
 

Constructor & Destructor Documentation

◆ TSLOpenGLSurfaceCreationParameters()

TSLOpenGLSurfaceCreationParameters::TSLOpenGLSurfaceCreationParameters ( )
inline

◆ ~TSLOpenGLSurfaceCreationParameters()

TSLOpenGLSurfaceCreationParameters::~TSLOpenGLSurfaceCreationParameters ( )
inline

Member Function Documentation

◆ createCoreProfile() [1/2]

bool TSLOpenGLSurfaceCreationParameters::createCoreProfile ( ) const
inline

Returns whether the drawing surface will attempt to create core profile contexts or not when creating OpenGL contexts. By default the drawing surface will attempt to create core profile contexts.

◆ createCoreProfile() [2/2]

void TSLOpenGLSurfaceCreationParameters::createCoreProfile ( bool coreProfile)
inline

Controls whether the drawing surface will attempt to create OpenGL contexts that use the OpenGL core profile. When this is true and the drawing surface is created using a constructor that does not take an existing OpenGL context the drawing surface will attempt to create an OpenGL 3.2 core profile context.

Setting this option to false will instead cause the drawing surface to attempt to create an OpenGL 3.2 compatibility profile context (i.e, an Open GL 3.2 context that includes the ARB_compatibility extension). Note that not all systems that support OpenGL 3.2 support the compatibility profile - on such a system the drawing surface will fail to attach if a compatibility context is requested.

This option has no effect on OpenGL ES systems, systems that do not support OpenGL 3.2, or systems that do not support the WGL_ARB_create_context or GLX_ ARB_create_context extensions. It has no effect when using a drawing surface constructor that does not create an OpenGL context.

If your application does not contain any OpenGL code then this value can be left on the default.

◆ enableDoubleBuffering() [1/2]

bool TSLOpenGLSurfaceCreationParameters::enableDoubleBuffering ( ) const
inline

Returns whether the drawing surface will use a double-buffered framebuffer configuration. By default double buffering is enabled.

Note: This option is ignored when used in conjunction with the TSLNative EGLSurface as many implementations do not support single buffered configurations.

◆ enableDoubleBuffering() [2/2]

void TSLOpenGLSurfaceCreationParameters::enableDoubleBuffering ( bool doubleBuffer)
inline

Controls whether the drawing surface will use a double-buffered framebuffer configuration.

Note: This option is ignored when used in conjunction with the TSLNative EGLSurface as many implementations do not support single buffered configurations.

By default double buffering is enabled.

◆ forceFallbackRenderer() [1/2]

bool TSLOpenGLSurfaceCreationParameters::forceFallbackRenderer ( ) const
inline

Returns whether the fallback renderer will be used regardless of the version of OpenGL the host system. By default the renderer used depends on the version of OpenGL supported.

◆ forceFallbackRenderer() [2/2]

void TSLOpenGLSurfaceCreationParameters::forceFallbackRenderer ( bool force)
inline

Controls whether the drawing surface will use the OpenGL 2.1 renderer even if the system supports OpenGL 3.2. This option should not normally need to be changed.

On some old or especially low end hardware the OpenGL 2.1 renderer in the drawing surface can perform significantly better than the OpenGL 3.2 renderer. On more powerful hardware the reverse is true.

Note that when using this option it must be enabled for all drawing surfaces created - enabling it only for some drawing surfaces may cause the drawing surface to malfunction.

This option has no effect on OpenGL ES systems and systems that do not support OpenGL 3.2

◆ numMultisampleSamples() [1/2]

int TSLOpenGLSurfaceCreationParameters::numMultisampleSamples ( ) const
inline

Returns the desired number of samples to request for anti-aliasing when creating an OpenGL context.

The default value is 0, which disables anti-aliasing.

◆ numMultisampleSamples() [2/2]

void TSLOpenGLSurfaceCreationParameters::numMultisampleSamples ( int numSamples)
inline

Sets the desired number of samples to request for anti-aliasing when creating an OpenGL context. Valid values are defined by the multisampling modes supported by the hardware. Commonly supported modes are 2 and 4.

Higher values have a stronger anti-aliasing effect but incur an increasing performance penalty.

This option has no effect when using a drawing surface constructor that does not create an OpenGL context.

The default value is 0, which disables anti-aliasing.

◆ shareContext() [1/2]

HGLRC TSLOpenGLSurfaceCreationParameters::shareContext ( ) const
inline

Get the OpenGL context we have been asked to share resources with.

Returns
the OpenGL context the OpenGL surface has been asked to share with.

◆ shareContext() [2/2]

void TSLOpenGLSurfaceCreationParameters::shareContext ( HGLRC context)
inline

Set the OpenGL context to share texture resources with.

The OpenGL context has to be compatible.

Make sure that the context being shared is not current in any thread.

Parameters
contextto share with.
Note
Only GLX and WIN32 implemented.

◆ swapBuffersManually() [1/2]

bool TSLOpenGLSurfaceCreationParameters::swapBuffersManually ( ) const
inline

Returns whether the user will perform buffer swaps when the drawing surface is attached to a double-buffered visual.

By default the drawing surface will perform buffer swaps automatically.

◆ swapBuffersManually() [2/2]

void TSLOpenGLSurfaceCreationParameters::swapBuffersManually ( bool swap)
inline

Controls whether the drawing surface will automatically perform a buffer swap after a draw. If this is true, the user is responsible for calling the appropriate buffer swap function when the drawing surface framebuffer is double-buffered.

Parameters
swapWhether the user will be responsible for performing buffer swaps on double-buffered visuals.

By default the drawing surface will perform buffer swaps automatically.

◆ useVSync() [1/2]

bool TSLOpenGLSurfaceCreationParameters::useVSync ( ) const
inline

Returns whether the drawing surface will attempt to enable vertical sync for draws.

By default the drawing surface will attempt to enable vsync.

◆ useVSync() [2/2]

void TSLOpenGLSurfaceCreationParameters::useVSync ( bool enable)
inline

Sets whether the drawing surface will attempt to enable vertical sync for draws in order to eliminate tearing of the display.

By default the drawing surface will attempt to enable vsync.