Frame Buffer Configuration

Frame Buffer Configuration — OpenGL frame buffer configuration object

Synopsis


#include <gdk/gdkgl.h>


enum        GdkGLConfigMode;
struct      GdkGLConfig;
GdkGLConfig* gdk_gl_config_new              (const int *attrib_list);
GdkGLConfig* gdk_gl_config_new_for_screen   (GdkScreen *screen,
                                             const int *attrib_list);
GdkGLConfig* gdk_gl_config_new_by_mode      (GdkGLConfigMode mode);
GdkGLConfig* gdk_gl_config_new_by_mode_for_screen
                                            (GdkScreen *screen,
                                             GdkGLConfigMode mode);
GdkScreen*  gdk_gl_config_get_screen        (GdkGLConfig *glconfig);
gboolean    gdk_gl_config_get_attrib        (GdkGLConfig *glconfig,
                                             int attribute,
                                             int *value);
GdkColormap* gdk_gl_config_get_colormap     (GdkGLConfig *glconfig);
GdkVisual*  gdk_gl_config_get_visual        (GdkGLConfig *glconfig);
gint        gdk_gl_config_get_depth         (GdkGLConfig *glconfig);
gint        gdk_gl_config_get_layer_plane   (GdkGLConfig *glconfig);
gint        gdk_gl_config_get_n_aux_buffers (GdkGLConfig *glconfig);
gint        gdk_gl_config_get_n_sample_buffers
                                            (GdkGLConfig *glconfig);
gboolean    gdk_gl_config_is_rgba           (GdkGLConfig *glconfig);
gboolean    gdk_gl_config_is_double_buffered
                                            (GdkGLConfig *glconfig);
gboolean    gdk_gl_config_is_stereo         (GdkGLConfig *glconfig);
gboolean    gdk_gl_config_has_alpha         (GdkGLConfig *glconfig);
gboolean    gdk_gl_config_has_depth_buffer  (GdkGLConfig *glconfig);
gboolean    gdk_gl_config_has_stencil_buffer
                                            (GdkGLConfig *glconfig);
gboolean    gdk_gl_config_has_accum_buffer  (GdkGLConfig *glconfig);


Object Hierarchy


  GObject
   +----GdkGLConfig

Description

Under GdkGLConfig there is a set of functions which allows to configure the framebuffer, i.e, all those things we have to define before anything is drawn. In order to get this sorted, a GdkGLConfig struct is arranged. This GdkGLconfig is created with gdk_gl_config_new and is afterwards used in gtk_widget_set_gl_capability.

Details

enum GdkGLConfigMode

typedef enum
{
  GDK_GL_MODE_RGB         = 0,
  GDK_GL_MODE_RGBA        = 0,       /* same as RGB */
  GDK_GL_MODE_INDEX       = 1 << 0,
  GDK_GL_MODE_SINGLE      = 0,
  GDK_GL_MODE_DOUBLE      = 1 << 1,
  GDK_GL_MODE_STEREO      = 1 << 2,
  GDK_GL_MODE_ALPHA       = 1 << 3,
  GDK_GL_MODE_DEPTH       = 1 << 4,
  GDK_GL_MODE_STENCIL     = 1 << 5,
  GDK_GL_MODE_ACCUM       = 1 << 6,
  GDK_GL_MODE_MULTISAMPLE = 1 << 7   /* not supported yet */
} GdkGLConfigMode;


struct GdkGLConfig

struct GdkGLConfig;


gdk_gl_config_new ()

GdkGLConfig* gdk_gl_config_new              (const int *attrib_list);

Returns an OpenGL frame buffer configuration that match the specified attributes.

Reserves an space in memory for containing OpenGL FrameBuffer configuration Data. Configuration data is sent via attrib_list. This array of gint contains attributes data stored in pairs {ATTRIBUTE_NAME1, value1, ATTRIBUTE_NAME2, value2, ...}, ending always with a GDK_ATTRIB_LIST_NONE. These attributes can be: GDK_GL_USE_GL,GDK_GL_BUFFER_SIZE, GDK_GL_LEVEL, GDK_GL_RGBA, GDK_GL_DOUBLEBUFFER, GDK_GL_STEREO, GDK_GL_AUX_BUFFERS, GDK_GL_RED_SIZE, GDK_GL_GREEN_SIZE, GDK_GL_BLUE_SIZE, GDK_GL_ALPHA_SIZE, GDK_GL_DEPTH_SIZE, GDK_GL_STENCIL_SIZE, GDK_GL_ACCUM_RED_SIZE, GDK_GL_ACCUM_GREEN_SIZE, GDK_GL_ACCUM_BLUE_SIZE and GDK_GL_ACCUM_ALPHA_SIZE.

attrib_list : a list of attribute/value pairs. The last attribute must be GDK_GL_ATTRIB_LIST_NONE.
Returns : the new GdkGLConfig.

gdk_gl_config_new_for_screen ()

GdkGLConfig* gdk_gl_config_new_for_screen   (GdkScreen *screen,
                                             const int *attrib_list);

screen :
attrib_list :
Returns :

gdk_gl_config_new_by_mode ()

GdkGLConfig* gdk_gl_config_new_by_mode      (GdkGLConfigMode mode);

Returns an OpenGL frame buffer configuration that match the specified display mode.

mode : display mode bit mask.
Returns : the new GdkGLConfig.

gdk_gl_config_new_by_mode_for_screen ()

GdkGLConfig* gdk_gl_config_new_by_mode_for_screen
                                            (GdkScreen *screen,
                                             GdkGLConfigMode mode);

screen :
mode :
Returns :

gdk_gl_config_get_screen ()

GdkScreen*  gdk_gl_config_get_screen        (GdkGLConfig *glconfig);

Get GdkScreen.

glconfig : a GdkGLConfig.
Returns : the GdkScreen.

gdk_gl_config_get_attrib ()

gboolean    gdk_gl_config_get_attrib        (GdkGLConfig *glconfig,
                                             int attribute,
                                             int *value);

Returns information about a OpenGL frame buffer configuration.

Returns the value one of the attributes which can be specified in gdk_gl_config_new.

glconfig : a GdkGLConfig.
attribute : the attribute to be returned.
value : returns the requested value.
Returns : an error code if it fails for any reason, otherwise, GDK_GL_SUCCESS is returned.

gdk_gl_config_get_colormap ()

GdkColormap* gdk_gl_config_get_colormap     (GdkGLConfig *glconfig);

Get the GdkColormap that is appropriate for the OpenGL frame buffer configuration.

Useful to get the appropiate colormap (GdkColormap) for the OpenGL framebuffer.

glconfig : a GdkGLConfig.
Returns : the appropriate GdkColormap.

gdk_gl_config_get_visual ()

GdkVisual*  gdk_gl_config_get_visual        (GdkGLConfig *glconfig);

Get the GdkVisual that is appropriate for the OpenGL frame buffer configuration.

glconfig : a GdkGLConfig.
Returns : the appropriate GdkVisual.

gdk_gl_config_get_depth ()

gint        gdk_gl_config_get_depth         (GdkGLConfig *glconfig);

Get the depth (number of bits per pixel) of the OpenGL-capable visual.

Color depth is a somehow confusing term. It is defined as the amount of bits per pixel used to define a color. It is confusing because in some environments is expressed as the amount of bits used to define each of the components (RGBA) of the color. Here it will be named as the total amount of bits required to define the whole color.

glconfig : a GdkGLConfig.
Returns : the depth value.

gdk_gl_config_get_layer_plane ()

gint        gdk_gl_config_get_layer_plane   (GdkGLConfig *glconfig);

Gets the layer plane (level) of the frame buffer. Zero is the default frame buffer. Positive layer planes correspond to frame buffers that overlay the default buffer, and negative layer planes correspond to frame buffers that underlie the default frame buffer.

glconfig : a GdkGLConfig.
Returns : layer plane.

gdk_gl_config_get_n_aux_buffers ()

gint        gdk_gl_config_get_n_aux_buffers (GdkGLConfig *glconfig);

Gets the number of auxiliary color buffers.

glconfig : a GdkGLConfig.
Returns : number of auxiliary color buffers.

gdk_gl_config_get_n_sample_buffers ()

gint        gdk_gl_config_get_n_sample_buffers
                                            (GdkGLConfig *glconfig);

Gets the number of multisample buffers.

glconfig : a GdkGLConfig.
Returns : number of multisample buffers.

gdk_gl_config_is_rgba ()

gboolean    gdk_gl_config_is_rgba           (GdkGLConfig *glconfig);

Returns whether the configured frame buffer is RGBA mode.

glconfig : a GdkGLConfig.
Returns : TRUE if the configured frame buffer is RGBA mode, FALSE otherwise.

gdk_gl_config_is_double_buffered ()

gboolean    gdk_gl_config_is_double_buffered
                                            (GdkGLConfig *glconfig);

Returns whether the configuration supports the double-buffered visual.

Checks for double buffering use in the GdkGLConfig struct. Double buffering is a technique use to avoid drawing directly in the viewable area. With double buffering, all entities drawn with OpenGL are stored in an invisible buffer. This buffer is then replaced by the frame buffer. Using Double-buffering, a big amount of memory is used to mantain this buffer, but quality is highly improved. Use gdk_drawable_swap_buffers to swap buffers when drawing is complete.

glconfig : a GdkGLConfig.
Returns : TRUE if the double-buffered visual is supported, FALSE otherwise.

gdk_gl_config_is_stereo ()

gboolean    gdk_gl_config_is_stereo         (GdkGLConfig *glconfig);

Returns whether the configuration supports the stereo visual.

Stereo Viewing deals with all techniques used to give 3D capabilities to a view, as for example are all kind of 3D and VR glasses. Generating 3D vision is a matter only of generating two views of the same scene, one for each eye. OpenGL does not support any specific hardware, but has the underlying support for using it. This function check for stereo support in a GdkGLConfig struct.

glconfig : a GdkGLConfig.
Returns : TRUE if the stereo visual is supported, FALSE otherwise.

gdk_gl_config_has_alpha ()

gboolean    gdk_gl_config_has_alpha         (GdkGLConfig *glconfig);

Returns whether the configured color buffer has alpha bits.

glconfig : a GdkGLConfig.
Returns : TRUE if the color buffer has alpha bits, FALSE otherwise.

gdk_gl_config_has_depth_buffer ()

gboolean    gdk_gl_config_has_depth_buffer  (GdkGLConfig *glconfig);

Returns whether the configured frame buffer has depth buffer.

glconfig : a GdkGLConfig.
Returns : TRUE if the frame buffer has depth buffer, FALSE otherwise.

gdk_gl_config_has_stencil_buffer ()

gboolean    gdk_gl_config_has_stencil_buffer
                                            (GdkGLConfig *glconfig);

Returns whether the configured frame buffer has stencil buffer.

glconfig : a GdkGLConfig.
Returns : TRUE if the frame buffer has stencil buffer, FALSE otherwise.

gdk_gl_config_has_accum_buffer ()

gboolean    gdk_gl_config_has_accum_buffer  (GdkGLConfig *glconfig);

Returns whether the configured frame buffer has accumulation buffer.

glconfig : a GdkGLConfig.
Returns : TRUE if the frame buffer has accumulation buffer, FALSE otherwise.