VVISF & VVGL
Sample Code I- Make a context

Creating a GLContext
If you want to work with OpenGL then you need an "OpenGL context", because a context is the primary interface for accessing GPU hardware using OpenGL. Every platform has its own native SDK for working with OpenGL, and they all have subtle differences- VVGL::GLContext/GLContextRef is an attempt to create a cross-platform class that presents the same interface across all platforms, but the exact call to create a GLContext is going to change slightly depending on which platform you're compiling VVGL against. The same holds true if you're compiling VVGL to use with another cross-platform GL solution, like GLFW or Qt.

Creating a new GLContext from an existing GLContext (all SDKs)

GLContextRef origCtx; // this is assumed to be non-nil in the real world...
GLContextRef newCtx = origCtx->newContextSharingMe();

Creating a new GLContext- simplest approach, but least control over the kind of context that gets created (all SDKs)

Creating a GLContext with the mac SDK:

NSOpenGLContext *origMacCtx; // this is assumed to be non-nil in the real world...
CGLContextObj tmpMacCtx = [origMacCtx CGLContextObj];
CGLPixelFormatObj tmpMacPxlFmt = [[origMacCtx pixelFormat] CGLPixelFormatObj];
// this makes a GLContext that wraps (and retains) an existing
// mac context (doesn't create a new OpenGL context)
GLContextRef vvglCtx = CreateGLContextRefUsing(tmpMacCtx, tmpMacCtx, tmpMacPxlFmt);
// this makes a GLContext that creates a new OpenGL context. this new
// context shares the passed context (they can share resources)
GLContextRef vvglCtx = CreateNewGLContextRef(tmpMacCtx, tmpMacPxlFmt);
// if you don't have an existing mac context- if you're creating the first context, for example...
// this makes a GLContext (and new OpenGL context) using
// the compatibility version of GL (GL 2.1 on os x)
GLContextRef vvglCtx = CreateNewGLContextRef(NULL, CreateCompatibilityGLPixelFormat());
// this makes a GLContext (and new OpenGL context) using GL4
GLContextRef vvglCtx = CreateNewGLContextRef(NULL, CreateGL4PixelFormat());

Creating a GLContext with the iOS SDK:

EAGLContext *tmpCtx; // this is assumed to be non-nil in the real world...
// this makes a GLContext that wraps (and retains) an existing
// iOS context (doesn't create a new OpenGL context)

Creating a GLContext with the GLFW SDK:

GLFWwindow * window; // this is assumed to be non-nil in the real world...
// this makes a GLContext that wraps the window's GL context
// (doesn't create a new OpenGL context)

Creating a GLContext with the Qt SDK:

QSurface * origSfc; // this is assumed to be non-nil in the real world...
QOpenGLContext * origCtx; // this is assumed to be non-nil in the real world...
QSurfaceFormat origSfcFmt; // this is assumed to be non-nil in the real world...
// this makes a GLContext that wraps and establishes a strong ref to
// the passed vars (doesn't create a new OpenGL context)
GLContextRef vvglCtx = CreateGLContextRefUsing(origSfc, origCtx, origSfcFmt);
// this makes a GLContext that creates a new OpenGL context. this new
// context shares the passed context (they can share resources)
GLContextRef vvglCtx = CreateNewGLContextRef(origSfc, origCtx, origSfcFmt);
// if you don't have an existing Qt context- if you're creating the first context, for example...
// this makes a GLContext (and new OpenGL context) using the default version of GL...
GLContextRef vvglCtx = CreateNewGLContextRef(nullptr, nullptr, CreateDefaultSurfaceFormat());
// this makes a GLContext (and new OpenGL context) using GL 4...
GLContextRef vvglCtx = CreateNewGLContextRef(nullptr, nullptr, CreateGL4SurfaceFormat());