A configuration which describes the capabilities of an OpenGL graphic surface. The configuration is used during construction of a surface. A surface supports additional configuration attributes which are specified during surface construction.
Graphic-Surface-Configuration | A configuration which describes the capabilities of an OpenGL graphic surface. |
Copyright | This program is free software. |
Files | |
C-kern/ | Header file Graphic-Surface-Configuration. |
C-kern/ | Implementation file Graphic-Surface-Configuration impl. |
Types | |
struct gconfig_t | Export gconfig_t into global namespace. |
gconfig_filter_t | Declares filter to select between different possible configuration. |
Enumerations | |
gconfig_e | |
gconfig_value_e | |
Functions | |
test | |
unittest_graphic_gconfig | Test gconfig_t functionality. |
gconfig_filter_t | Declares filter to select between different possible configuration. |
Macros | |
gconfig_filter_INIT | Static initializer. |
gconfig_t | Contains a specific surface configuration. |
lifetime | |
gconfig_INIT | Static initializer. |
gconfig_FREE | Static initializer. |
init_gconfig | Returns an OpenGL surface configuration for display. |
initfiltered_gconfig | Same as init_gconfig except that more than one possible configuration is considered. |
initfromconfigid_gconfig | Returns an OpenGL surface configuration whose ID matches configid. |
free_gconfig | Frees any memory associated with a configuration. |
query | |
gl_gconfig | Returns the native OpenGL surface config. |
value_gconfig | Returns the value of attribute stored in gconf. |
configid_gconfig | Returns the configuration ID of gconf. |
visualid_gconfig | Returns the native visualid of the configuration. |
maxpbuffer_gconfig | Returns the maximum size of an off-screen pixel buffer. |
inline implementation | |
gconfig_t | |
free_gconfig | Implements gconfig_t.free_gconfig. |
configid_gconfig | Implements gconfig_t.configid_gconfig. |
gl_gconfig | Implements gconfig_t.gl_gconfig. |
maxpbuffer_gconfig | Implements gconfig_t.maxpbuffer_gconfig. |
value_gconfig | Implements gconfig_t.value_gconfig. |
visualid_gconfig | Implements gconfig_t.visualid_gconfig. |
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
© 2014 Jörg Seebohn
Header file Graphic-Surface-Configuration.
Implementation file Graphic-Surface-Configuration impl.
typedef struct gconfig_t gconfig_t
Export gconfig_t into global namespace.
typedef struct gconfig_filter_t gconfig_filter_t
Declares filter to select between different possible configuration. The filter function must return true if it accepts the visual ID given in parameter visualid else false. If no visualid passes the filter <initfiltered_eglconfig> returns ESRCH.
gconfig_NONE | This is the last entry in a list to indicate termination. |
gconfig_TYPE | The configuration supports drawing into a specific surface type. Supported values are any combination of bits ored together from gconfig_value_TYPE_WINDOW_BIT, ... . |
gconfig_TRANSPARENT_ALPHA | A value != 0 sets a flag which makes the background of a window surface shine through. Default value is 0. The alpha value of a pixel determines its opacity. Use this to overlay a window surface to another window surface. This attribute must be supplied during creation of a window to enable alpha transparency. An alpha value of 1 means the pixel is fully opaque. An alpha value of 0 means the pixel is fully transparent so the background of a window is visible with 100%. If the alpha channel has 8 bits then the value 255 corresponds to 1 and the value 128 to 0.5. Blending function on X11: The blending function assumes that every pixel’s color value is premultiplied by alpha. |
Screen-Pixel-RGB = Window-Pixel-RGB + (1 | Window-Pixel-Alpha) * Background-Pixel-RGB Before drawing you need to change the color of the pixels to: Window-Pixel-RGB = Window-Pixel-RGB * Window-Pixel-Alpha |
gconfig_BITS_BUFFER | The minimum number of bits per pixel for all color channels together including alpha. |
gconfig_BITS_RED | The minimum number of bits per pixel which determine the red color. The number of red bits the color buffer supports, e.g. 8 on current hardware. |
gconfig_BITS_GREEN | The minimum number of bits per pixel which determine the green color. The number of green bits the color buffer supports, e.g. 8 on current hardware. |
gconfig_BITS_BLUE | The minimum number of bits per pixel which determine the blue color. The number of blue bits the color buffer supports, e.g. 8 on current hardware. |
gconfig_BITS_ALPHA | The minimum number of bits per pixel which determine the alpha value (1: fully opaque, 0: fully transparent). The number of alpha bits the color buffer supports, e.g. 8 on current hardware. |
gconfig_BITS_DEPTH | The minimum number of bits the depth buffer must support. If set to 0 no depth buffer is supported. |
gconfig_BITS_STENCIL | The minimum number of bits the stencil buffer must support. If set to 0 no stencil buffer is supported. |
gconfig_CONFORMANT | Determine the supported drawing APIs. Supported values are any combination of bits ored together from gconfig_value_CONFORMANT_ES1_BIT, gconfig_value_CONFORMANT_ES2_BIT, gconfig_value_CONFORMANT_OPENGL_BIT, gconfig_value_CONFORMANT_OPENVG_BIT. |
gconfig_NROFELEMENTS | Gives the number of all valid configuration options excluding gconfig_NROFELEMENTS. |
test | |
unittest_graphic_gconfig | Test gconfig_t functionality. |
int unittest_graphic_gconfig( void )
Test gconfig_t functionality.
struct gconfig_filter_t
Declares filter to select between different possible configuration. The filter function accept must return true if it accepts the visual ID given in parameter visualid else false. If no visualid passes the constructor <initfiltered_gconfig> returns ESRCH.
Macros | |
gconfig_filter_INIT | Static initializer. |
struct gconfig_t
Contains a specific surface configuration.
lifetime | |
gconfig_INIT | Static initializer. |
gconfig_FREE | Static initializer. |
init_gconfig | Returns an OpenGL surface configuration for display. |
initfiltered_gconfig | Same as init_gconfig except that more than one possible configuration is considered. |
initfromconfigid_gconfig | Returns an OpenGL surface configuration whose ID matches configid. |
free_gconfig | Frees any memory associated with a configuration. |
query | |
gl_gconfig | Returns the native OpenGL surface config. |
value_gconfig | Returns the value of attribute stored in gconf. |
configid_gconfig | Returns the configuration ID of gconf. |
visualid_gconfig | Returns the native visualid of the configuration. |
maxpbuffer_gconfig | Returns the maximum size of an off-screen pixel buffer. |
int init_gconfig( /*out*/gconfig_t * gconf, struct display_t * display, const int32_t config_attributes[] )
Returns an OpenGL surface configuration for display. The parameters stored in config_attributes must be tupels of type (gconfig_e value, int value) followed by the end of list value gconfig_NONE. The display parameter must be valid as long as gconf is valid. Uses initfiltered_gconfig to implement its functionality. The internal filter is created from a call to <configfilter_x11window> (in case of X11 as selected UI).
int initfiltered_gconfig( /*out*/gconfig_t * gconf, struct display_t * display, const int32_t config_attributes[], gconfig_filter_t * filter )
Same as init_gconfig except that more than one possible configuration is considered. The provided filter is repeatedly called for every possible configuration as long as it returns false. The first configuration which passes the filter is used. Parameter user is passed as user data into the filter function.
int value_gconfig( const gconfig_t * gconf, struct display_t * display, int32_t attribute, /*out*/int32_t * value )
Returns the value of attribute stored in gconf. Set attribute to a value from gconfig_e and display must be set to the same display given in the init function.
int maxpbuffer_gconfig( const gconfig_t * gconf, struct display_t * display, /*out*/uint32_t * maxwidth, /*out*/uint32_t * maxheight, /*out*/uint32_t * maxpixels )
Returns the maximum size of an off-screen pixel buffer. The values are returned in maxwidth(in pixels), maxheight(in pixels) and maxpixels(width*height). The parameter maxpixels may be less than maxwidth multiplied by maxheight. If one of the out parameter is set to NULL no value is returned.
gconfig_t | |
free_gconfig | Implements gconfig_t.free_gconfig. |
configid_gconfig | Implements gconfig_t.configid_gconfig. |
gl_gconfig | Implements gconfig_t.gl_gconfig. |
maxpbuffer_gconfig | Implements gconfig_t.maxpbuffer_gconfig. |
value_gconfig | Implements gconfig_t.value_gconfig. |
visualid_gconfig | Implements gconfig_t.visualid_gconfig. |
#define free_gconfig( gconf ) (*(gconf) = (gconfig_t) gconfig_FREE, 0)
Implements gconfig_t.free_gconfig.
#define configid_gconfig( gconf, display, configid ) configid_eglconfig(gl_gconfig(gconf), gl_display(display), configid)
Implements gconfig_t.configid_gconfig.
#define gl_gconfig( gconf ) ((gconf)->glconfig)
Implements gconfig_t.gl_gconfig.
#define maxpbuffer_gconfig( gconf, display, maxwidth, maxheight, maxpixels ) maxpbuffer_eglconfig(gl_gconfig(gconf), gl_display(display), maxwidth, maxheight, maxpixels)
Implements gconfig_t.maxpbuffer_gconfig.
#define value_gconfig( gconf, display, attribute, value ) value_eglconfig(gl_gconfig(gconf), gl_display(display), attribute, value)
Implements gconfig_t.value_gconfig.
#define visualid_gconfig( gconf, display, visualid ) visualconfigid_eglconfig(gl_gconfig(gconf), gl_display(display), visualid)
Implements gconfig_t.visualid_gconfig.
Export gconfig_t into global namespace.
typedef struct gconfig_t gconfig_t
Contains a specific surface configuration.
struct gconfig_t
Declares filter to select between different possible configuration.
typedef struct gconfig_filter_t gconfig_filter_t
Test gconfig_t functionality.
int unittest_graphic_gconfig( void )
Static initializer.
#define gconfig_filter_INIT( accept, user ) { user, accept }
Static initializer.
#define gconfig_INIT( glconfig ) { glconfig }
Static initializer.
#define gconfig_FREE { 0 }
Returns an OpenGL surface configuration for display.
int init_gconfig( /*out*/gconfig_t * gconf, struct display_t * display, const int32_t config_attributes[] )
Same as init_gconfig except that more than one possible configuration is considered.
int initfiltered_gconfig( /*out*/gconfig_t * gconf, struct display_t * display, const int32_t config_attributes[], gconfig_filter_t * filter )
Returns an OpenGL surface configuration whose ID matches configid.
int initfromconfigid_gconfig( /*out*/gconfig_t * gconf, struct display_t * display, const uint32_t configid )
Frees any memory associated with a configuration.
int free_gconfig( gconfig_t * gconf )
Returns the native OpenGL surface config.
struct opengl_config_t * gl_gconfig( const gconfig_t * gconf )
Returns the value of attribute stored in gconf.
int value_gconfig( const gconfig_t * gconf, struct display_t * display, int32_t attribute, /*out*/int32_t * value )
Returns the configuration ID of gconf.
int configid_gconfig( const gconfig_t * gconf, struct display_t * display, /*out*/uint32_t * configid )
Returns the native visualid of the configuration.
int visualid_gconfig( const gconfig_t * gconf, struct display_t * display, /*out*/int32_t * visualid )
Returns the maximum size of an off-screen pixel buffer.
int maxpbuffer_gconfig( const gconfig_t * gconf, struct display_t * display, /*out*/uint32_t * maxwidth, /*out*/uint32_t * maxheight, /*out*/uint32_t * maxpixels )
Implements gconfig_t.free_gconfig.
#define free_gconfig( gconf ) (*(gconf) = (gconfig_t) gconfig_FREE, 0)
Implements gconfig_t.configid_gconfig.
#define configid_gconfig( gconf, display, configid ) configid_eglconfig(gl_gconfig(gconf), gl_display(display), configid)
Implements gconfig_t.gl_gconfig.
#define gl_gconfig( gconf ) ((gconf)->glconfig)
Implements gconfig_t.maxpbuffer_gconfig.
#define maxpbuffer_gconfig( gconf, display, maxwidth, maxheight, maxpixels ) maxpbuffer_eglconfig(gl_gconfig(gconf), gl_display(display), maxwidth, maxheight, maxpixels)
Implements gconfig_t.value_gconfig.
#define value_gconfig( gconf, display, attribute, value ) value_eglconfig(gl_gconfig(gconf), gl_display(display), attribute, value)
Implements gconfig_t.visualid_gconfig.
#define visualid_gconfig( gconf, display, visualid ) visualconfigid_eglconfig(gl_gconfig(gconf), gl_display(display), visualid)