Maintainer | [email protected] |
---|---|
Stability | provisional |
Portability | portable (depends on GHC) |
Safe Haskell | None |
Language | Haskell98 |
Graphics.UI.Gtk.Gdk.GLContext
Description
OpenGL context
Synopsis
- data GLContext
- class GObjectClass o => GLContextClass o
- castToGLContext :: GObjectClass obj => obj -> GLContext
- gTypeGLContext :: GType
- glContextGetDisplay :: GLContextClass self => self -> IO (Maybe Display)
- glContextGetWindow :: GLContextClass self => self -> IO (Maybe DrawWindow)
- glContextGetSharedContext :: GLContextClass self => self -> IO (Maybe GLContext)
- glContextGetVersion :: GLContextClass self => self -> IO (Int, Int)
- glContextSetRequiredVersion :: GLContextClass self => self -> Int -> Int -> IO ()
- glContextGetRequiredVersion :: GLContextClass self => self -> IO (Int, Int)
- glContextSetDebugEnabled :: GLContextClass self => self -> Bool -> IO ()
- glContextGetDebugEnabled :: GLContextClass self => self -> IO Bool
- glContextSetForwardCompatible :: GLContextClass self => self -> Bool -> IO ()
- glContextGetForwardCompatible :: GLContextClass self => self -> IO Bool
- glContextRealize :: GLContextClass self => self -> IO Bool
- glContextIsLegacy :: GLContextClass self => self -> IO Bool
- glContextMakeCurrent :: GLContextClass self => self -> IO ()
- glContextGetCurrent :: IO (Maybe GLContext)
- glContextClearCurrent :: IO ()
Detail
GLContext is an object representing the platform-specific OpenGL drawing context.
GLContexts are created for a GdkWindow, and the context will match the GdkVisual of the window.
A GLContext
is not tied to any particular normal framebuffer. For instance, it cannot draw to
the Window back buffer. The GDK repaint system is in full control of the painting to that.
GDK will handle the integration of your rendering with that of other widgets.
Support for GLContext
is platform-specific, context creation can fail, returning NULL context.
A GLContext
has to be made "current" in order to start using it, otherwise any OpenGL call will
be ignored.
Class Hierarchy
Types
Instances
Eq GLContext Source # | |
Ord GLContext Source # | |
GObjectClass GLContext Source # | |
Defined in Graphics.UI.Gtk.Types | |
GLContextClass GLContext Source # | |
Defined in Graphics.UI.Gtk.Types |
class GObjectClass o => GLContextClass o Source #
Instances
GLContextClass GLContext Source # | |
Defined in Graphics.UI.Gtk.Types |
castToGLContext :: GObjectClass obj => obj -> GLContext Source #
Methods
glContextGetDisplay :: GLContextClass self => self -> IO (Maybe Display) Source #
Retrieves the Display
the context is created for.
glContextGetWindow :: GLContextClass self => self -> IO (Maybe DrawWindow) Source #
Retrieves the DrawWindow
used by the context.
glContextGetSharedContext :: GLContextClass self => self -> IO (Maybe GLContext) Source #
Retrieves the GLContext
that this context share data with.
glContextGetVersion :: GLContextClass self => self -> IO (Int, Int) Source #
Retrieves the OpenGL version of the context.
The context must be realized prior to calling this function.
glContextSetRequiredVersion :: GLContextClass self => self -> Int -> Int -> IO () Source #
Sets the major and minor version of OpenGL to request.
Setting major and minor to zero will use the default values.
The GLContext
must not be realized or made current prior to calling this function.
glContextGetRequiredVersion :: GLContextClass self => self -> IO (Int, Int) Source #
Retrieves the major and minor version requested by calling glContextSetRequiredVersion
.
glContextSetDebugEnabled :: GLContextClass self => self -> Bool -> IO () Source #
glContextGetDebugEnabled :: GLContextClass self => self -> IO Bool Source #
Retrieves the value set using glContextSetDebugEnabled.
glContextSetForwardCompatible :: GLContextClass self => self -> Bool -> IO () Source #
Sets whether the GLContext
should be forward compatible.
Forward compatible contexts must not support OpenGL functionality that has been marked as deprecated in the requested version; non-forward compatible contexts, on the other hand, must support both deprecated and non deprecated functionality.
The GLContext
must not be realized or made current prior to calling this function.
glContextGetForwardCompatible :: GLContextClass self => self -> IO Bool Source #
Retrieves the value set using glContextSetForwardCompatible.
glContextRealize :: GLContextClass self => self -> IO Bool Source #
glContextIsLegacy :: GLContextClass self => self -> IO Bool Source #
Whether the GLContext
is in legacy mode or not.
The GLContext
must be realized before calling this function.
When realizing a GL context, GDK will try to use the OpenGL 3.2 core profile; this profile removes all the OpenGL API that was deprecated prior to the 3.2 version of the specification. If the realization is successful, this function will return False.
If the underlying OpenGL implementation does not support core profiles, GDK will fall back to a pre-3.2 compatibility profile, and this function will return True.
You can use the value returned by this function to decide which kind of OpenGL API to use, or whether to do extension discovery, or what kind of shader programs to load.
glContextMakeCurrent :: GLContextClass self => self -> IO () Source #
Makes the context the current one.
glContextClearCurrent :: IO () Source #
Clears the current GLContext
.
Any OpenGL call after this function returns will be ignored until glContextMakeCurrent is called.