## GritsCallback GritsCallback — Custom callback objects |

## Synopsis

    struct              GritsCallback;
    struct              GritsCallbackClass;
    void                (*GritsCallbackFunc)                (GritsCallback *callback,
                                                             GritsOpenGL *opengl,
                                                             gpointer user_data);
    GritsCallback *     grits_callback_new                  (GritsCallbackFunc draw_cb,
                                                             gpointer user_data);

## Object Hierarchy

      GObject
       +----GritsObject
             +----GritsCallback

## Description

GritsCallback objects are used for custom drawing functions. A common example of this would be to render something which does not easily fit into a normal object. For instance, a Heads-Up-Display overlay.

Callbacks are an alternate to extending GritsObject with a new class and should be used when only once instance of the object will be needed.

## Details

### struct GritsCallback

    struct GritsCallback;

### struct GritsCallbackClass

    struct GritsCallbackClass {
    	GritsObjectClass parent_class;
    };

### GritsCallbackFunc ()

    void                (*GritsCallbackFunc)                (GritsCallback *callback,
                                                             GritsOpenGL *opengl,
                                                             gpointer user_data);

A function to be called when the callback object is being rendered

`callback` : | the callback object to be drawn
`user_data` : | the user data associated with the callback

### grits_callback_new ()

    GritsCallback *     grits_callback_new                  (GritsCallbackFunc draw_cb,
                                                             gpointer user_data);

Create a GritsCallback object with an associated function and user data.

`user_data` : | user data to pass to the drawing function
Returns : | the new GritsCallback