gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library
Maintainer[email protected]
Stabilityprovisional
Portabilityportable (depends on GHC)
Safe HaskellNone
LanguageHaskell98

Graphics.UI.Gtk.Gdk.GLContext

Description

OpenGL context

Synopsis

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

| GObject
| +----GLContext

Types

class GObjectClass o => GLContextClass o Source #

Instances

Instances details
GLContextClass GLContext Source # 
Instance details

Defined in Graphics.UI.Gtk.Types

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 #

Sets whether the GLContext should perform extra validations and run time checking. This is useful during development, but has additional overhead.

The GLContext must not be realized or made current prior to calling this function.

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 #

Realizes the given GLContext.

It is safe to call this function on a realized GLContext.

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.