gwydgets — Base functions
void | gwy_widgets_type_init () |
gboolean | gwy_widgets_gl_init () |
GdkGLConfig * | gwy_widgets_get_gl_config () |
typedef | GdkGLConfig |
#include <libgwydgets/gwydgets.h>
Gwyddion classes has to be initialized before they can be safely
deserialized. The function gwy_type_init()
performs this initialization.
Before 3D widgets (Gwy3DView) can be used, OpenGL must be initialized with
gwy_widgets_gl_init()
.
void
gwy_widgets_type_init (void
);
Makes libgwydgets types safe for deserialization and performs other initialization. You have to call this function before using widgets and objects from libgwydgets.
Calls gwy_draw_type_init()
first to make sure libgwydraw is initialized.
It is safe to call this function more than once, subsequent calls are no-op.
gboolean
gwy_widgets_gl_init (void
);
Configures an OpenGL-capable visual for 3D widgets.
Use gwy_widgets_get_gl_config()
to get the framebuffer configuration.
This function must be called before OpenGL widgets can be used.
TRUE
if an appropriate visual was found. If Gwyddion was compiled
without OpenGL support, it always returns FALSE
.
GdkGLConfig *
gwy_widgets_get_gl_config (void
);
Returns OpenGL framebuffer configuration for 3D widgets.
Call gwy_widgets_gl_init()
first.
The OpenGL framebuffer configuration, NULL
if OpenGL
initialization was not successfull.
typedef void GdkGLConfig;
Placeholder typedef.
If Gwyddion is compiled with OpenGL (i.e., GtkGLExt) this is the real
GdkGLConfig. However, if Gwyddion is compiled without OpenGLthis type is typedefed as void.
Since one cannot actually use any of the Gwyddion OpenGL widgets if they are not enabled, this usually works well. However, it can break in the unlikely case one compiles with wibgwydgets that have OpenGL disabled and at the same time he uses GtkGLExt directly. In such case
GdkGLConfig is defined twice. The only known fix is notto include gwydgets.h
and GtkGLExt headers in the same
source file.