EGL-Framebuffer-Configuration

Describes a frame buffer / surface configuration for a given egldisplay_t.

Summary
EGL-Framebuffer-ConfigurationDescribes a frame buffer / surface configuration for a given egldisplay_t.
CopyrightThis program is free software.
Files
C-kern/api/platform/OpenGL/EGL/eglconfig.hHeader file EGL-Framebuffer-Configuration.
C-kern/platform/OpenGL/EGL/eglconfig.cImplementation file EGL-Framebuffer-Configuration impl.
Types
struct opengl_config_tExport <opengl_config_t > into global namespace.
struct eglconfig_tExport eglconfig_t into global namespace.
eglconfig_filter_fDeclares filter to select between different possible configuration.
Functions
test
unittest_platform_opengl_egl_eglconfigTest eglconfig_t functionality.
eglconfig_tContains an EGL frame buffer configuration.
lifetime
eglconfig_FREEStatic initializer.
init_eglconfigReturns a configuration which matches the given attributes.
initfiltered_eglconfigSame as init_eglconfig except that more than one possible configuration is considered.
initfromconfigid_eglconfigReturns a configuration with ID id.
free_eglconfigFrees any associated resources.
query
value_eglconfigReturns the value of attribute.
visualconfigid_eglconfigReturns the native visualid of the configuration.
configid_eglconfigReturns the ID of configuration eglconf in id.
maxpbuffer_eglconfigReturns the maximum size of an off-screen pixel buffer.
inline implementation
Macros
free_eglconfigImplements eglconfig_t.free_eglconfig.

Copyright

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.

Author

© 2014 Jörg Seebohn

Files

C-kern/api/platform/OpenGL/EGL/eglconfig.h

C-kern/platform/OpenGL/EGL/eglconfig.c

Types

struct opengl_config_t

typedef struct opengl_config_t * opengl_config_t

Export <opengl_config_t > into global namespace.

struct eglconfig_t

Export eglconfig_t into global namespace.

eglconfig_filter_f

typedef bool (
   *eglconfig_filter_f
) (eglconfig_t eglconf, int32_t visualid, void * user)

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.

Functions

test

unittest_platform_opengl_egl_eglconfig

int unittest_platform_opengl_egl_eglconfig(void)

Test eglconfig_t functionality.

eglconfig_t

typedef struct opengl_config_t * eglconfig_t

Contains an EGL frame buffer configuration.

Summary
lifetime
eglconfig_FREEStatic initializer.
init_eglconfigReturns a configuration which matches the given attributes.
initfiltered_eglconfigSame as init_eglconfig except that more than one possible configuration is considered.
initfromconfigid_eglconfigReturns a configuration with ID id.
free_eglconfigFrees any associated resources.
query
value_eglconfigReturns the value of attribute.
visualconfigid_eglconfigReturns the native visualid of the configuration.
configid_eglconfigReturns the ID of configuration eglconf in id.
maxpbuffer_eglconfigReturns the maximum size of an off-screen pixel buffer.

lifetime

eglconfig_FREE

#define eglconfig_FREE 0

Static initializer.

init_eglconfig

int init_eglconfig(/*out*/eglconfig_t *eglconf,
struct opengl_display_t *egldisp,
const int32_t config_attributes[])

Returns a configuration which matches the given attributes.  The configuration determines the type of frame buffer supported by surfaces or OpenGL contexts.  The parameters stored in config_attributes must be tupels of type (gconfig_e value, int value) followed by the termination value gconfig_NONE.

Returns

0Success, eglconf is valid.
E2BIGAttributes list in config_attributes is too long, eglconf is not changed.
EINVALEither egldisp is invalid, an invalid gconfig_e is supplied or the supplied integer value is invalid for the corresponding gconfig_e attribute id.
ESRCHNo configuration matches the supplied attribues.

initfiltered_eglconfig

int initfiltered_eglconfig(/*out*/eglconfig_t *eglconf,
struct opengl_display_t *egldisp,
const int32_t config_attributes[],
eglconfig_filter_f filter,
void *user)

Same as init_eglconfig 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.

initfromconfigid_eglconfig

int initfromconfigid_eglconfig(/*out*/eglconfig_t *eglconf,
struct opengl_display_t *egldisp,
const uint32_t id)

Returns a configuration with ID id.  Use this function to create a copy of a configuration assigned to a surface (window, pbuffer) or a context.

free_eglconfig

int free_eglconfig(eglconfig_t *eglconf)

Frees any associated resources.  Currently this is a no-op.

query

value_eglconfig

int value_eglconfig(eglconfig_t eglconf,
struct opengl_display_t *egldisp,
const int32_t attribute,
/*out*/int32_t *value)

Returns the value of attribute.  The parameter egldisp must be of type egldisplay_t and parameter attribute must be a value from gconfig_e.  On error EINVAL is returned else 0.

visualconfigid_eglconfig

int visualconfigid_eglconfig(eglconfig_t eglconf,
struct opengl_display_t *egldisp,
/*out*/int32_t *visualid)

Returns the native visualid of the configuration.  Use this id to create a native window with the correct surface graphic attributes.

configid_eglconfig

int configid_eglconfig(eglconfig_t eglconf,
struct opengl_display_t *egldisp,
/*out*/uint32_t *id)

Returns the ID of configuration eglconf in id.  You can use id to create an exact copy of eglconf.

maxpbuffer_eglconfig

int maxpbuffer_eglconfig(eglconfig_t eglconf,
struct opengl_display_t *egldisp,
/*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).  If one of the out parameter is set to NULL no value is returned.

inline implementation

Macros

free_eglconfig

#define free_eglconfig(eglconf) (*(eglconf) = eglconfig_FREE, 0)

Implements eglconfig_t.free_eglconfig.

Describes a frame buffer / surface configuration for a given egldisplay_t.
Implements EGL-Framebuffer-Configuration.
typedef struct opengl_config_t * opengl_config_t
Export <opengl_config_t > into global namespace.
typedef struct opengl_config_t * eglconfig_t
Contains an EGL frame buffer configuration.
typedef bool (
   *eglconfig_filter_f
) (eglconfig_t eglconf, int32_t visualid, void * user)
Declares filter to select between different possible configuration.
int unittest_platform_opengl_egl_eglconfig(void)
Test eglconfig_t functionality.
#define eglconfig_FREE 0
Static initializer.
int init_eglconfig(/*out*/eglconfig_t *eglconf,
struct opengl_display_t *egldisp,
const int32_t config_attributes[])
Returns a configuration which matches the given attributes.
int initfiltered_eglconfig(/*out*/eglconfig_t *eglconf,
struct opengl_display_t *egldisp,
const int32_t config_attributes[],
eglconfig_filter_f filter,
void *user)
Same as init_eglconfig except that more than one possible configuration is considered.
int initfromconfigid_eglconfig(/*out*/eglconfig_t *eglconf,
struct opengl_display_t *egldisp,
const uint32_t id)
Returns a configuration with ID id.
int free_eglconfig(eglconfig_t *eglconf)
Frees any associated resources.
int value_eglconfig(eglconfig_t eglconf,
struct opengl_display_t *egldisp,
const int32_t attribute,
/*out*/int32_t *value)
Returns the value of attribute.
int visualconfigid_eglconfig(eglconfig_t eglconf,
struct opengl_display_t *egldisp,
/*out*/int32_t *visualid)
Returns the native visualid of the configuration.
int configid_eglconfig(eglconfig_t eglconf,
struct opengl_display_t *egldisp,
/*out*/uint32_t *id)
Returns the ID of configuration eglconf in id.
int maxpbuffer_eglconfig(eglconfig_t eglconf,
struct opengl_display_t *egldisp,
/*out*/uint32_t *maxwidth,
/*out*/uint32_t *maxheight,
/*out*/uint32_t *maxpixels)
Returns the maximum size of an off-screen pixel buffer.
#define free_eglconfig(eglconf) (*(eglconf) = eglconfig_FREE, 0)
Implements eglconfig_t.free_eglconfig.
This is the last entry in a list to indicate termination.
Close