gstgl.glcontext

Module for [GLContext] class

Types 3

#GstGLContext wraps an OpenGL context object in a uniform API. As a result of the limitation on OpenGL context, this object is not thread safe unless specified and must only be activated in a single thread.

Environment variables:

  • GST_GL_API: select which OpenGL API to create and OpenGL context for. Depending on the platform, the available values are 'opengl', 'opengl3' (core profile), and 'gles2'. See the the #GstGLAPI enumeration for more details.
  • GST_GL_PLATFORM: select which OpenGL platform to create an OpenGL context with. Depending on the platform and the dependencies available build-time, the available values are, 'glx', 'egl', 'cgl', 'wgl', and 'eagl'
  • GST_GL_CONFIG: select the configuration used for creating the OpenGL context and OpenGL surface. Written out as a GstStructure that has been serialized to string. e.g. GST_GL_CONFIG="gst-gl-context-config,red-size=8,green-size=8,blue-size=8,alpha-size=8,depth-size=16". Not all platforms will support the same level of functionality.
Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
GLContext self() nothrowReturns `this`, for use in `with` statements.
GLContextGidBuilder builder() static nothrowGet builder for [gstgl.glcontext.GLContext] Returns: New builder object
gstgl.glcontext.GLContext newWrapped(gstgl.gldisplay.GLDisplay display, size_t handle, gstgl.types.GLPlatform contextType, gstgl.types.GLAPI availableApis) static nothrowWraps an existing OpenGL context into a #GstGLContext.
void * defaultGetProcAddress(gstgl.types.GLAPI glApi, string name) static nothrowA default implementation of the various GetProcAddress functions that looks for name in the OpenGL shared libraries or in the current process.
gstgl.glcontext.GLContext getCurrent() static nothrowSee also [gstgl.glcontext.GLContext.activate]. Returns: the #GstGLContext active in the current thread or null
gstgl.types.GLAPI getCurrentGlApi(gstgl.types.GLPlatform platform, out uint major, out uint minor) static nothrowIf an error occurs, major and minor are not modified and [gstgl.types.GLAPI.None] is returned.
size_t getCurrentGlContext(gstgl.types.GLPlatform contextType) static nothrow
void * getProcAddressWithPlatform(gstgl.types.GLPlatform contextType, gstgl.types.GLAPI glApi, string name) static nothrowAttempts to use the context_type specific GetProcAddress implementations to retrieve name.
bool activate(bool activate) nothrow(De)activate the OpenGL context represented by this context.
bool canShare(gstgl.glcontext.GLContext otherContext) nothrowNote: This will always fail for two wrapped #GstGLContext's
bool checkFeature(string feature) nothrowCheck for an OpenGL feature being supported.
bool checkFramebufferStatus(uint fboTarget) nothrowMust be called with context current.
bool checkGlVersion(gstgl.types.GLAPI api, int maj, int min) nothrow
void clearFramebuffer() nothrowUnbind the current framebuffer
void clearShader() nothrowClear's the currently set shader from the GL state machine.
bool create(gstgl.glcontext.GLContext otherContext = null)Creates an OpenGL context with the specified other_context as a context to share shareable OpenGL objects with. See the OpenGL specification for what is shared between OpenGL contexts.
void destroy() nothrowDestroys an OpenGL context.
bool fillInfo()Fills context's info (version, extensions, vtable, etc) from the GL context in the current thread. Typically used with wrapped contexts to allow wrapped contexts to be used as regular #GstGLContex...
gst.structure.Structure getConfig() nothrowRetrieve the OpenGL configuration for this context. The context must have been successfully created for this function to return a valid value.
gstgl.types.GLAPI getGlApi() nothrowGet the currently enabled OpenGL api.
size_t getGlContext() nothrowGets the backing OpenGL context used by context. Returns: The platform specific backing OpenGL context
gstgl.types.GLPlatform getGlPlatform() nothrowGets the OpenGL platform that used by context. Returns: The platform specific backing OpenGL context
void getGlPlatformVersion(out int major, out int minor) nothrowGet the version of the OpenGL platform (GLX, EGL, etc) used. Only valid after a call to [gstgl.glcontext.GLContext.create].
void getGlVersion(out int maj, out int min) nothrowReturns the OpenGL version implemented by context. See [gstgl.glcontext.GLContext.getGlApi] for retrieving the OpenGL api implemented by context.
void * getProcAddress(string name) nothrowGet a function pointer to a specified opengl function, name. If the the specific function does not exist, NULL is returned instead.
bool isShared() nothrow
bool requestConfig(gst.structure.Structure glConfig = null) nothrowSet the OpenGL configuration for this context. The context must not have been created for this function to succeed. Setting a null config has the affect of removing any specific configuration req...
void setSharedWith(gstgl.glcontext.GLContext share) nothrowWill internally set context as shared with share
bool setWindow(gstgl.glwindow.GLWindow window) nothrowSet's the current window on context to window. The window can only be changed before [gstgl.glcontext.GLContext.create] has been called and the window is not already running.
void swapBuffers() nothrowSwap the front and back buffers on the window attached to context. This will display the frame on the next refresh cycle.
void threadAdd(gstgl.types.GLContextThreadFunc func) nothrowExecute func in the OpenGL thread of context with data
Constructors
this(void * ptr, Flag!"Take" take)
this(gstgl.gldisplay.GLDisplay display)Create a new #GstGLContext with the specified display

Fluent builder implementation template for gstgl.glcontext.GLContext

Fluent builder for gstgl.glcontext.GLContext

Methods
GLContext build() nothrowCreate object from builder. Returns: New object