| Gtk OpenGL Toolkit (gtkogltk) Reference Manual |
|---|
#include <ogltk/object.h> enum GlObjectTypes; struct ogltk_globject; gboolean ogltk_globject_set_type (GLobject *globject, GlObjectTypes type); gboolean ogltk_globject_destroy (GLobject *globject); GlObjectTypes ogltk_globject_type (GLobject *globject); gboolean ogltk_globject_set_name (GLobject *globject, const char *name); const char* ogltk_globject_get_name (GLobject *globject); gboolean ogltk_globject_select (GLobject *globject, gboolean enable); gboolean ogltk_globject_is_selected (GLobject *globject); gboolean ogltk_globject_set_translate_matrix (GLobject *globject, gfloat x, gfloat y, gfloat z); gboolean ogltk_globject_enable_rotate_matrix (GLobject *globject); gboolean ogltk_globject_set_rotate_matrix (GLobject *globject, gfloat angle, gfloat x, gfloat y, gfloat z); gboolean ogltk_globject_set_rotate_matrix_and_enable (GLobject *globject, gfloat angle, gfloat x, gfloat y, gfloat z); gboolean ogltk_globject_disable_rotate_matrix (GLobject *globject); gboolean ogltk_globject_update_rotate_matrix_angle (GLobject *globject, gfloat angle); const gltTranslate* ogltk_globject_get_translate_matrix (GLobject *globject); const gltRotate* ogltk_globject_get_rotate_matrix (GLobject *globject); const gltColor* ogltk_globject_get_color (GLobject *globject); gboolean ogltk_globject_set_color (GLobject *globject, gfloat red, gfloat green, gfloat blue, gfloat alpha); gboolean ogltk_globject_draw_color (GLobject *globject);
typedef enum
{
GLOBJECT_TYPE_NONE,
GLOBJECT_TYPE_PRIMITIVES,
GLOBJECT_TYPE_DISPLAY_LIST,
GLOBJECT_TYPE_CUSTOM,
GLOBJECT_TYPE_LAST
}GlObjectTypes;struct ogltk_globject {
GObject parent_instance;
/* Properties */
GlObjectTypes type;
gchar *name;
gltTranslate translate;
gltRotate rotate;
gboolean selected;
gltColor *color;
};gboolean ogltk_globject_set_type (GLobject *globject,
GlObjectTypes type);Set the type of OGLTK object this is See GlObjectTypes.
| globject : | An OpenGL object |
| type : | The type of object this is. |
| Returns : | True if the type has been set. |
gboolean ogltk_globject_destroy (GLobject *globject);
Destroy an instance of an GLobject.
| globject : | An OpenGL object |
| Returns : | True if the object is destroyed. |
GlObjectTypes ogltk_globject_type (GLobject *globject);
Get the ogltk type of this GL object.
| globject : | An OpenGL object |
| Returns : |
gboolean ogltk_globject_set_name (GLobject *globject,
const char *name);Set the name property for this object.
| globject : | An OpenGL object |
| name : | New name for this object. |
| Returns : | True if the name was set/changed. |
const char* ogltk_globject_get_name (GLobject *globject);
Get the name of the GLobject
| globject : | An OpenGL object |
| Returns : | A constant pointer to the object name. |
gboolean ogltk_globject_select (GLobject *globject,
gboolean enable);Set this object to be enabled or disabled.
| globject : | An OpenGL object |
| enable : | Enable this object to be selected. |
| Returns : | True if the object select field was changed |
gboolean ogltk_globject_is_selected (GLobject *globject);
Check if this object has been flagged as selected.
| globject : | An OpenGL object |
| Returns : | True if it's been selected. |
gboolean ogltk_globject_set_translate_matrix
(GLobject *globject,
gfloat x,
gfloat y,
gfloat z);Set where this object should be drawn.
| globject : | An OpenGL object |
| x : | X Axis location. |
| y : | Y Axis location |
| z : | Z Axix location |
| Returns : | True if the object's new location has been set. |
gboolean ogltk_globject_enable_rotate_matrix
(GLobject *globject);Enable the rotation matrix for this object.
| globject : | An OpenGL object |
| Returns : | True if the rotation matrix has been enabled. |
gboolean ogltk_globject_set_rotate_matrix
(GLobject *globject,
gfloat angle,
gfloat x,
gfloat y,
gfloat z);Set the object's rotation matrix (x,y & z) by the param angle. Note : The rotation matrix needs to be enabled before the method ogltk_globject_rotate to work.
| globject : | An OpenGL object |
| angle : | New angle for the matrix |
| x : | Apply to the X axis of the object. |
| y : | Apply to the Y axis of the object. |
| z : | Apply to the Z axis of the object. |
| Returns : | True if the rotation matrix has been set for this object. |
gboolean ogltk_globject_set_rotate_matrix_and_enable
(GLobject *globject,
gfloat angle,
gfloat x,
gfloat y,
gfloat z);Same as ogltk_globject_set_rotate_matrix excepts enables the matrix
| globject : | An OpenGL object |
| angle : | New angle for the matrix |
| x : | Apply to the X axis of the object. |
| y : | Apply to the Y axis of the object. |
| z : | Apply to the Z axis of the object. |
| Returns : | True if the rotation matrix has been set and enabled for this object. |
gboolean ogltk_globject_disable_rotate_matrix
(GLobject *globject);Disabled the rotation matrix for this object.
| globject : | An OpenGL object |
| Returns : | True if the rotation matrix has been disabled. |
gboolean ogltk_globject_update_rotate_matrix_angle
(GLobject *globject,
gfloat angle);Apply the param angle to the rotation matrix for this object.
| globject : | An OpenGL object |
| angle : | Angle to apply to rotation matrix. |
| Returns : | True if the matrix angle has been updated. |
const gltTranslate* ogltk_globject_get_translate_matrix
(GLobject *globject);Get the translation matrix settings for this object. The x,y and z settings are in the gltTranslate struct.
| globject : | An OpenGL object |
| Returns : | Constant pointer to gltTranslate for this object. |
const gltRotate* ogltk_globject_get_rotate_matrix
(GLobject *globject);Get the rotation matrix settings for this object. The x,y,z angle and enabled settings are in the gltRotate struct.
| globject : | An OpenGL object |
| Returns : | Constant pointer to gltRotate for this object |
const gltColor* ogltk_globject_get_color (GLobject *globject);
Get the color values for this object. The red, green, blue and alpha settings are in the gltColor struct.
| globject : | An OpenGL object |
| Returns : | Constant pointer to gltColor for this object. |
gboolean ogltk_globject_set_color (GLobject *globject,
gfloat red,
gfloat green,
gfloat blue,
gfloat alpha);Set the color for this object using RGBA values.
| globject : | An OpenGL 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 the color has been set for this object. |
gboolean ogltk_globject_draw_color (GLobject *globject);
Calling lower level OpenGL color, Set the current color. In the ogltk scene, this is called before the draw method for this object.
| globject : | An OpenGL object |
| Returns : | True if setting the current color was successful. |
| <<< ogltk_view | ogltk-lightsource >>> |