glt-color

Name

glt-color -- Color Type used for all gtkogltk objects.

Synopsis


#include <ogltk/glt_color.h>


struct      glt_color;
gltColor*   glt_color_new                   (void);
gltColor*   glt_color_new_color             (gfloat red,
                                             gfloat green,
                                             gfloat blue,
                                             gfloat alpha);
gboolean    glt_color_destroy               (gltColor *color);
gboolean    glt_color_set_gl                (gltColor *color,
                                             gfloat red,
                                             gfloat green,
                                             gfloat blue,
                                             gfloat alpha);
gboolean    glt_color_draw                  (gltColor *color);
#define     glt_color_get_red               (c)
#define     glt_color_get_green             (c)
#define     glt_color_get_blue              (c)
#define     glt_color_get_alpha             (c)
#define     glt_color_set_red_gl            (c,v)
#define     glt_color_set_green_gl          (c,v)
#define     glt_color_set_blue_gl           (c,v)
#define     glt_color_set_alpha_gl          (c,v)

Description

Details

struct glt_color

struct glt_color {

    gfloat      red;
    gfloat      green;
    gfloat      blue;    
    gfloat      alpha;
};


glt_color_new ()

gltColor*   glt_color_new                   (void);

Create a new instance of an OpenGL color object with default colors.

Returns :

new gltColor instance.


glt_color_new_color ()

gltColor*   glt_color_new_color             (gfloat red,
                                             gfloat green,
                                             gfloat blue,
                                             gfloat alpha);

Create a new instance of an OpenGL color object.

red :

Red value for this color.

green :

Green value for this color.

blue :

Blue value for this color.

alpha :

Alpha (intensity) value for this color.

Returns :

new gltColor instance.


glt_color_destroy ()

gboolean    glt_color_destroy               (gltColor *color);

Destroy/Unallocate the instance of the gltColor object.

color :

gltColor object

Returns :

True if destroyed.


glt_color_set_gl ()

gboolean    glt_color_set_gl                (gltColor *color,
                                             gfloat red,
                                             gfloat green,
                                             gfloat blue,
                                             gfloat alpha);

Set all color components in the gltColor object.

color :

gltColor object

red :

Red value for this color.

green :

Green value for this color.

blue :

Blue value for this color.

alpha :

Alpha (intensity) value for this color.

Returns :

True if set.


glt_color_draw ()

gboolean    glt_color_draw                  (gltColor *color);

Draw the gltColor to the OpenGL state machine.

color :

gltColor object

Returns :

True if successful.


glt_color_get_red()

#define             glt_color_get_red(c)            (gfloat)(c->red)

Get the red component in the gltColor object.

c :

gltColor object


glt_color_get_green()

#define             glt_color_get_green(c)          (gfloat)(c->green)

Get the green component in the gltColor object.

c :

gltColor object


glt_color_get_blue()

#define             glt_color_get_blue(c)           (gfloat)(c->blue)

Get the blue component in the gltColor object.

c :

gltColor object


glt_color_get_alpha()

#define             glt_color_get_alpha(c)          (gfloat)(c->alpha)

Get the alpha (intensity) component in the gltColor object.

c :

gltColor object


glt_color_set_red_gl()

#define             glt_color_set_red_gl(c,v)       c->red = v

Set the red component in the gltColor object.

c :

gltColor object

v :

Color Value


glt_color_set_green_gl()

#define             glt_color_set_green_gl(c,v)     c->green = v

Set the green component in the gltColor object.

c :

gltColor object

v :

Color Value


glt_color_set_blue_gl()

#define             glt_color_set_blue_gl(c,v)      c->blue = v

Set the blue component in the gltColor object.

c :

gltColor object

v :

Color Value


glt_color_set_alpha_gl()

#define             glt_color_set_alpha_gl(c,v)     c->alpha = v

Set the alpha (intensity) component in the gltColor object.

c :

gltColor object

v :

Alpha Value