Top | ![]() |
![]() |
![]() |
![]() |
This module is used to support a background colour and to tune the fog. This last one can be turn on or off and its colour can be either a user defined one or the one of the background. The fog is a linear blending into the fog colour. It starts at a given z position (in the camera basis set) and ends at a lower z.
VisuGlExtBg *
visu_gl_ext_bg_new (const gchar *name
);
Creates a new VisuGlExt to draw bg.
Since: 3.7
gboolean visu_gl_ext_bg_setFile (VisuGlExtBg *bg
,const gchar *path
,GError **error
);
Loads path
and store it as a background image for the scene, see
visu_gl_ext_bg_setImage()
.
Since: 3.8
void visu_gl_ext_bg_setImage (VisuGlExtBg *bg
,const guchar *imageData
,guint width
,guint height
,gboolean alpha
,const gchar *title
,gboolean fit
);
Draw the imageData
on the background. The image is scaled to the
viewport dimensions, keeping the width/height ratio, if fit
is set
to TRUE. If title
is not NULL, the title is also printed on the
background. The image data are copied and can be free after this
call.
bg |
a VisuGlExtBg object. |
|
imageData |
raw image data in RGB or RGBA format ;. |
[allow-none] |
width |
the width ; |
|
height |
the height ; |
|
alpha |
TRUE if the image is RGBA ; |
|
title |
an optional title (can be NULL). |
[allow-none] |
fit |
a boolean (default is TRUE). |
gboolean visu_gl_ext_bg_setFollowCamera (VisuGlExtBg *bg
,gboolean follow
,float zoomInit
,float xs
,float ys
);
When follow
is TRUE, the size and the position of the background
image is adjusted with every camera change.
bg |
a VisuGlExtBg object. |
|
follow |
a boolean. |
|
zoomInit |
a floating point value. |
|
xs |
a floating point value. |
|
ys |
a floating point value. |
Since: 3.7
gboolean visu_gl_ext_bg_setCamera (VisuGlExtBg *bg
,float zoom
,float xs
,float ys
);
If the background image is in follow mode, see
visu_gl_ext_bg_setFollowCamera()
, this routine is used to update
the current camera settings of the background image.
bg |
a VisuGlExtBg object. |
|
zoom |
a floating point value. |
|
xs |
a floating point value. |
|
ys |
a floating point value. |
Since: 3.7
#define VISU_GL_EXT_BG_ID "Background"
The id used to identify this extension, see
visu_gl_ext_rebuild()
for instance.
“background-file”
property“background-file” gchar *
path to the background image.
Flags: Read / Write
Default value: ""
“display-background-filename”
property“display-background-filename” gboolean
display or not the background filename.
Flags: Read / Write
Default value: FALSE