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 _gType() @property
GLContext self()Returns `this`, for use in `with` statements.
GLContextGidBuilder builder()Get 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)Wraps an existing OpenGL context into a #GstGLContext.
void * defaultGetProcAddress(gstgl.types.GLAPI glApi, string name)A 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()See 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)If an error occurs, major and minor are not modified and [gstgl.types.GLAPI.None] is returned.
void * getProcAddressWithPlatform(gstgl.types.GLPlatform contextType, gstgl.types.GLAPI glApi, string name)Attempts to use the context_type specific GetProcAddress implementations to retrieve name.
bool activate(bool activate)(De)activate the OpenGL context represented by this context.
bool canShare(gstgl.glcontext.GLContext otherContext)Note: This will always fail for two wrapped #GstGLContext's
bool checkFeature(string feature)Check for an OpenGL feature being supported.
bool checkFramebufferStatus(uint fboTarget)Must be called with context current.
bool checkGlVersion(gstgl.types.GLAPI api, int maj, int min)
void clearFramebuffer()Unbind the current framebuffer
void clearShader()Clear'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()Destroys 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()Retrieve 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()Get the currently enabled OpenGL api.
size_t getGlContext()Gets the backing OpenGL context used by context. Returns: The platform specific backing OpenGL context
gstgl.types.GLPlatform getGlPlatform()Gets the OpenGL platform that used by context. Returns: The platform specific backing OpenGL context
void getGlPlatformVersion(out int major, out int minor)Get 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)Returns the OpenGL version implemented by context. See [gstgl.glcontext.GLContext.getGlApi] for retrieving the OpenGL api implemented by context.
void * getProcAddress(string name)Get a function pointer to a specified opengl function, name. If the the specific function does not exist, NULL is returned instead.
bool isShared()
bool requestConfig(gst.structure.Structure glConfig = null)Set 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)Will internally set context as shared with share
bool setWindow(gstgl.glwindow.GLWindow window)Set'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()Swap 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)Execute 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 for [gstgl.glcontext.GLContext]

Methods