VVISF & VVGL
|
GLContext is an attempt to make a platform/SDK-agnostic representation of an OpenGL context. More...
#include <GLContext.hpp>
Public Member Functions | |
GLContextRef | newContextSharingMe () const |
Creates and returns a new OpenGL context in the same sharegroup as the receiver. | |
void | makeCurrent () |
Makes this GL context current. | |
void | makeCurrentIfNotCurrent () |
Makes this GL context current if it isn't already current. | |
void | makeCurrentIfNull () |
Makes this GL context current if no context is current. | |
bool | sameShareGroupAs (const GLContextRef &inCtx) |
Returns a true if the passed context is in the same sharegroup as the receiver. | |
Public Attributes | |
GLVersion | version = GLVersion_Unknown |
The version of OpenGL this context is using. | |
Related Functions | |
(Note that these are not member functions.) | |
using | GLContextRef = shared_ptr< GLContext > |
A GLContextRef is a shared pointer around a GLContext. | |
QSurfaceFormat | CreateDefaultSurfaceFormat () |
Creates a surface format describing the default OpenGL surface settings for this platform. | |
QSurfaceFormat | CreateCompatibilityGLSurfaceFormat () |
Creates a surface format describing the compatibility profile of OpenGL for this platform. | |
QSurfaceFormat | CreateGL3SurfaceFormat () |
Creates a surface format describing the OpenGL 3 profile for this platform. | |
QSurfaceFormat | CreateGL4SurfaceFormat () |
Creates a surface format describing the OpenGL 4 profile for this platform. | |
GLContextRef | CreateGLContextRefUsing (QSurface *inTargetSurface, QOpenGLContext *inCtx, QSurfaceFormat inSfcFmt=CreateDefaultSurfaceFormat()) |
Doesn't create any GL resources, just makes a new GLContext instance using the passed resources. More... | |
GLContextRef | CreateNewGLContextRef (QSurface *inTargetSurface, QOpenGLContext *inShareCtx, QSurfaceFormat inSfcFmt=CreateDefaultSurfaceFormat()) |
Creates a new OpenGL context and GLContext instance. More... | |
GLContextRef | CreateNewGLContextRef () |
Creates a generic OpenGL context and GLContext instance using whatever the default settings are for this platform and SDK. | |
GLContext is an attempt to make a platform/SDK-agnostic representation of an OpenGL context.
GLContext is a OpenGL context- this class wraps up whatever the native object is for whatever platform/SDK you're compiling VVGL against, and presents a single standard interface across all platforms for the rest of VVGL and any libs that derive from it. You can create a GLContext around an existing platform-specific OpenGL context- which makes integration with existing codebases easy- or you can also create new OpenGL contexts by making a new instance of GLContext or using the newContextSharingMe() member function of an existing context. Has explicit support for sharing of multiple contexts so resources (textures, models, etc) can be shared between contexts.
Notes on use:
|
related |
Doesn't create any GL resources, just makes a new GLContext instance using the passed resources.
inTargetSurface | If null, a QOffscreenSurface will be created. If non-null (a widget or window or etc), we just store a weak ref to the passed surface. |
inCtx | Must be non-null. A weak ref is made to this context- the GLContext instance that is created is basically just a wrapper around this context. |
inSfcFmt | The surface format describes what kind of OpenGL environment you want to work with. The QSurfaceFormat can be created using one of the Create****SurfaceFormat() functions listed in this document. |
|
related |
Creates a new OpenGL context and GLContext instance.
inTargetSurface | If null, a QOffscreenSurface will be created. If non-null (a widget or window or etc), we just store a weak ref to the passed surface. |
inShareCtx | The OpenGL context that gets created will be in the same sharegroup as this context. |
inSfcFmt | The surface format describes what kind of OpenGL environment you want to work with. The QSurfaceFormat can be created using one of the Create****SurfaceFormat() functions listed in this document. |