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. | |
uint32_t | GLDisplayMaskForAllScreens () |
Returns an OpenGL display mask that covers all visible screens. | |
CGLPixelFormatObj | CreateDefaultPixelFormat () |
Creates a pixel format using the system's default OpenGL context settings (compatibility). | |
CGLPixelFormatObj | CreateCompatibilityGLPixelFormat () |
Creates a pixel format using the system's OpenGL compatibility settings. | |
CGLPixelFormatObj | CreateGL3PixelFormat () |
Creates a pixel format using the OpenGL 3, if possible. | |
CGLPixelFormatObj | CreateGL4PixelFormat () |
Creates a pixel format using the OpenGL 4 profile, if possible. | |
GLContextRef | CreateGLContextRefUsing (const CGLContextObj &inCtx, const CGLContextObj &inShareCtx, const CGLPixelFormatObj &inPxlFmt=CreateDefaultPixelFormat()) |
Doesn't create any GL resources, just makes a new GLContext instnace that retains the passed objects. | |
GLContextRef | CreateNewGLContextRef (const CGLContextObj &inShareCtx, const CGLPixelFormatObj &inPxlFmt=CreateDefaultPixelFormat()) |
Creates a new GL context using the passed pixel format and share context. | |
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: