| libg3d Reference Manual | ||||
|---|---|---|---|---|
#include <g3d/g3d.h>
G3DContext;
G3DContext* g3d_context_new (void);
void g3d_context_free (G3DContext *context);
gboolean (*G3DSetBgColorFunc) (G3DFloat r,
G3DFloat g,
G3DFloat b,
G3DFloat a,
gpointer user_data);
gboolean (*G3DUpdateInterfaceFunc) (gpointer user_data);
gboolean (*G3DUpdateProgressBarFunc) (G3DFloat percentage,
gboolean show,
gpointer user_data);
gboolean g3d_context_update_interface (G3DContext *context);
void g3d_context_set_update_interface_func
(G3DContext *context,
G3DUpdateInterfaceFunc func,
gpointer user_data);
gboolean g3d_context_update_progress_bar (G3DContext *context,
G3DFloat percentage,
gboolean visibility);
void g3d_context_set_update_progress_bar_func
(G3DContext *context,
G3DUpdateProgressBarFunc func,
gpointer user_data);
gboolean g3d_context_set_bgcolor (G3DContext *context,
G3DFloat r,
G3DFloat g,
G3DFloat b,
G3DFloat a);
void g3d_context_set_set_bgcolor_func (G3DContext *context,
G3DSetBgColorFunc func,
gpointer user_data);
All state information is saved in the context. It also serves as an interface to the application.
G3DContext* g3d_context_new (void);
Create a new context. This initializes the library (and also the plugin system so this has not to be done seperately).
Returns : |
a valid context, or NULL on failure. |
void g3d_context_free (G3DContext *context);
Cleans up the context and the plugin system and frees all reserved memory.
|
the context to free |
gboolean (*G3DSetBgColorFunc) (G3DFloat r, G3DFloat g, G3DFloat b, G3DFloat a, gpointer user_data);
Background color setting callback.
|
red component |
|
green component |
|
blue component |
|
alpha component |
|
opaque data as given to g3d_context_set_set_bgcolor_func()
|
Returns : |
TRUE on success, FALSE else. |
gboolean (*G3DUpdateInterfaceFunc) (gpointer user_data);
Interface updating callback.
|
opaque data as given to g3d_context_set_update_interface_func()
|
Returns : |
TRUE on success, FALSE else. |
gboolean (*G3DUpdateProgressBarFunc) (G3DFloat percentage, gboolean show, gpointer user_data);
Progress updating callback.
|
progress of plugin operation |
|
TRUE if the progress bar should be visible, FALSE else |
|
opaque data as given to
g3d_context_set_update_progress_bar_func()
|
Returns : |
TRUE on success, FALSE else. |
gboolean g3d_context_update_interface (G3DContext *context);
Try to update the interface. This will call a function registered with
g3d_context_set_update_interface_func.
|
a valid context |
Returns : |
TRUE on success, FALSE else |
void g3d_context_set_update_interface_func
(G3DContext *context,
G3DUpdateInterfaceFunc func,
gpointer user_data);
Registers a callback function for updating the interface.
|
a valid context |
|
the callback function |
|
user-defined opaque pointer |
gboolean g3d_context_update_progress_bar (G3DContext *context, G3DFloat percentage, gboolean visibility);
Try to update the progress bar.
|
a valid context |
|
the percentage to set on the progress bar |
|
show or hide the progress bar |
Returns : |
TRUE on success, FALSE else |
void g3d_context_set_update_progress_bar_func
(G3DContext *context,
G3DUpdateProgressBarFunc func,
gpointer user_data);
Registers a callback function for updating the progress bar.
|
a valid context |
|
the callback function |
|
user-defined opaque pointer |
gboolean g3d_context_set_bgcolor (G3DContext *context, G3DFloat r, G3DFloat g, G3DFloat b, G3DFloat a);
Try to set the background color. This will call a function registered
with g3d_context_set_set_bgcolor_func.
|
a valid context |
|
red component (range: 0.0 .. 1.0) |
|
green component (range: 0.0 .. 1.0) |
|
green component (range: 0.0 .. 1.0) |
|
alpha component |
Returns : |
TRUE on success, FALSE else |
void g3d_context_set_set_bgcolor_func (G3DContext *context, G3DSetBgColorFunc func, gpointer user_data);
Registers a callback function for setting the background color.
|
a valid context |
|
the callback function |
|
user-defined opaque pointer |