gtk3-0.14.5: Binding to the Gtk+ 3 graphical user interface library

Maintainergtk2hs-users@lists.sourceforge.net
Stabilityprovisional
Portabilityportable (depends on GHC)
Safe HaskellNone
LanguageHaskell98

Graphics.UI.Gtk.Misc.GLArea

Contents

Description

A widget for custom drawing with OpenGL

Synopsis

Detail

The GLArea is a widget that allows drawing with OpenGL.

GLArea sets up its own GLContext for the window it creates, and creates a custom GL framebuffer that the widget will do GL rendering onto. It also ensures that this framebuffer is the default GL rendering target when rendering.

In order to draw, you have to connect to the glAreaRender signal.

The GLArea widget ensures that the GLContext is associated with the widget's drawing area, and it is kept updated when the size and position of the drawing area changes.

If you need to initialize OpenGL state, e.g. buffer objects or shaders, you should use the realize signal; you can use the unrealize signal to clean up.

To receive mouse events on a drawing area, you will need to enable them with widgetAddEvents. To receive keyboard events, you will need to set the widgetCanFocus attribute on the drawing area.

Class Hierarchy

| GObject
| +----Object
| +----Widget
| +----GLArea

Types

Constructors

Methods

Attributes

Signals