ctk-render-target

## ctk-render-target ctk-render-target — Represents a target for effects to render to. |

## Synopsis

    #define             CTK_TYPE_RENDER_TARGET
                        CtkRenderTarget;
    enum                CtkRenderTargetFlags;
    GType               ctk_render_target_get_type          (void);
    CtkRenderTarget *   ctk_render_target_new               (void);
    CtkRenderTarget *   ctk_render_target_new_sized         (guint width,
                                                             guint height);
    void                ctk_render_target_resize            (CtkRenderTarget *self,
                                                             guint width,
                                                             guint height);
    void                ctk_render_target_free              (CtkRenderTarget *self);
    void                ctk_render_target_bind              (CtkRenderTarget *self);
    void                ctk_render_target_unbind            (void);
    guint               ctk_render_target_get_width         (CtkRenderTarget *self);
    guint               ctk_render_target_get_height        (CtkRenderTarget *self);
    guint               ctk_render_target_get_depth_buffer_ogl_id
                                                            (CtkRenderTarget *self);
    guint               ctk_render_target_get_color_buffer_ogl_id
                                                            (CtkRenderTarget *self);
    guint               ctk_render_target_get_frame_buffer_ogl_id
                                                            (CtkRenderTarget *self);
    void                ctk_render_target_get_size          (CtkRenderTarget *self,
                                                             guint *width,
                                                             guint *height);
    CtkRenderTargetFlags  ctk_render_target_get_flags       (CtkRenderTarget *self);
    void                ctk_render_target_set_flags         (CtkRenderTarget *self,
                                                             CtkRenderTargetFlags flags);

## Description

CtkRenderTarget FIXME: needs elaboration

## Details

### CTK_TYPE_RENDER_TARGET

    #define CTK_TYPE_RENDER_TARGET (ctk_render_target_get_type ())

### CtkRenderTarget

    typedef struct _CtkRenderTarget CtkRenderTarget;

### enum CtkRenderTargetFlags

    typedef enum
    {
      CTK_RENDER_TARGET_IN_USE = 1 << 0,
      CTK_RENDER_TARGET_STACKED = 1 << 1

    } CtkRenderTargetFlags;

### ctk_render_target_get_type ()

    GType               ctk_render_target_get_type          (void);

Returns : |

### ctk_render_target_new ()

    CtkRenderTarget *   ctk_render_target_new               (void);

Creates a new CtkRenderTarget with only the fbo set

Returns : | a new CtkRenderTarget

### ctk_render_target_new_sized ()

    CtkRenderTarget *   ctk_render_target_new_sized         (guint width,
                                                             guint height);

As ctk_render_target_new, but the `CtkRenderTarget` will also have a sized texture attached if `width` and `height` are non-zero

`width` : | the width of the desired texture, can be zero
`height` : | the height of the desired texture, can be zero
Returns : | a new CtkRenderTarget

### ctk_render_target_resize ()

    void                ctk_render_target_resize            (CtkRenderTarget *self,
                                                             guint width,
                                                             guint height);

Will resize the texture associated with `self`. WARNING: This function changes the binding of the render target. Calling this function will replace the previous render-target that was bound to the framebuffer

`self` : | the CtkRenderTarget to resize
`width` : | the width of the desired texture
`height` : | the height of the desired texture

### ctk_render_target_free ()

    void                ctk_render_target_free              (CtkRenderTarget *self);

Will free itself, plus any memory allocated for any textures that are present.

`self` : | the CtkRenderTarget to free

### ctk_render_target_bind ()

    void                ctk_render_target_bind              (CtkRenderTarget *self);

Will bind `self` (and it's texture, if it exists) to the framebuffer

`self` : | the CtkRenderTarget to bind

### ctk_render_target_unbind ()

    void                ctk_render_target_unbind            (void);

Will unbind `self` from the framebuffer

### ctk_render_target_get_width ()

    guint               ctk_render_target_get_width         (CtkRenderTarget *self);

Will retrieve the width of `self`

`self` : | a CtkRenderTarget
Returns : | the width of `self`

### ctk_render_target_get_height ()

    guint               ctk_render_target_get_height        (CtkRenderTarget *self);

Will retrieve the opengl id of the frame buffer of `self`

`self` : | a CtkRenderTarget
Returns : | the opengl id of the frame buffer of `self`

### ctk_render_target_get_depth_buffer_ogl_id ()

    guint               ctk_render_target_get_depth_buffer_ogl_id
                                                            (CtkRenderTarget *self);

`self` : |
Returns : |

### ctk_render_target_get_color_buffer_ogl_id ()

    guint               ctk_render_target_get_color_buffer_ogl_id
                                                            (CtkRenderTarget *self);

`self` : |
Returns : |

### ctk_render_target_get_frame_buffer_ogl_id ()

    guint               ctk_render_target_get_frame_buffer_ogl_id
                                                            (CtkRenderTarget *self);

`self` : |
Returns : |

### ctk_render_target_get_size ()

    void                ctk_render_target_get_size          (CtkRenderTarget *self,
                                                             guint *width,
                                                             guint *height);

Will populate `width` and `height` with the size of `self`

`self` : | a CtkRenderTarget
`width` : | a location to store the width. out.
`height` : | a location to store the height. out.

### ctk_render_target_get_flags ()

    CtkRenderTargetFlags  ctk_render_target_get_flags       (CtkRenderTarget *self);

`self` : | a CtkRenderTarget
Returns : | the current CtkRenderTargetFlags for `self`

### ctk_render_target_set_flags ()

    void                ctk_render_target_set_flags         (CtkRenderTarget *self,
                                                             CtkRenderTargetFlags flags);

Sets the CtkRenderTargetFlags of `self` to `flags`

`self` : | a CtkRenderTarget
`flags` : | CtkRenderTargetFlags