2005-04-22 22:09:39 +01:00
|
|
|
#ifndef EGLCONFIG_INCLUDED
|
|
|
|
#define EGLCONFIG_INCLUDED
|
|
|
|
|
|
|
|
|
2009-09-25 15:54:34 +01:00
|
|
|
#include <assert.h>
|
2010-11-01 13:30:22 +00:00
|
|
|
#include <stddef.h>
|
2005-04-22 22:09:39 +01:00
|
|
|
#include "egltypedefs.h"
|
|
|
|
|
|
|
|
|
2010-10-14 09:25:30 +01:00
|
|
|
/* update _eglValidationTable and _eglOffsetOfConfig before updating this
|
|
|
|
* struct */
|
2005-04-22 22:09:39 +01:00
|
|
|
struct _egl_config
|
|
|
|
{
|
2009-09-25 16:43:49 +01:00
|
|
|
_EGLDisplay *Display;
|
2010-10-14 09:25:30 +01:00
|
|
|
|
|
|
|
/* core */
|
|
|
|
EGLint BufferSize;
|
|
|
|
EGLint AlphaSize;
|
|
|
|
EGLint BlueSize;
|
|
|
|
EGLint GreenSize;
|
|
|
|
EGLint RedSize;
|
|
|
|
EGLint DepthSize;
|
|
|
|
EGLint StencilSize;
|
|
|
|
EGLint ConfigCaveat;
|
|
|
|
EGLint ConfigID;
|
|
|
|
EGLint Level;
|
|
|
|
EGLint MaxPbufferHeight;
|
|
|
|
EGLint MaxPbufferPixels;
|
|
|
|
EGLint MaxPbufferWidth;
|
|
|
|
EGLint NativeRenderable;
|
|
|
|
EGLint NativeVisualID;
|
|
|
|
EGLint NativeVisualType;
|
|
|
|
EGLint Samples;
|
|
|
|
EGLint SampleBuffers;
|
|
|
|
EGLint SurfaceType;
|
|
|
|
EGLint TransparentType;
|
|
|
|
EGLint TransparentBlueValue;
|
|
|
|
EGLint TransparentGreenValue;
|
|
|
|
EGLint TransparentRedValue;
|
|
|
|
EGLint BindToTextureRGB;
|
|
|
|
EGLint BindToTextureRGBA;
|
|
|
|
EGLint MinSwapInterval;
|
|
|
|
EGLint MaxSwapInterval;
|
|
|
|
EGLint LuminanceSize;
|
|
|
|
EGLint AlphaMaskSize;
|
|
|
|
EGLint ColorBufferType;
|
|
|
|
EGLint RenderableType;
|
|
|
|
EGLint MatchNativePixmap;
|
|
|
|
EGLint Conformant;
|
|
|
|
|
|
|
|
/* extensions */
|
|
|
|
EGLint YInvertedNOK;
|
2005-04-22 22:09:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-09-25 15:54:34 +01:00
|
|
|
/**
|
2010-10-14 09:25:30 +01:00
|
|
|
* Map an EGL attribute enum to the offset of the member in _EGLConfig.
|
2009-09-25 15:54:34 +01:00
|
|
|
*/
|
|
|
|
static INLINE EGLint
|
2010-10-14 09:25:30 +01:00
|
|
|
_eglOffsetOfConfig(EGLint attr)
|
2009-09-25 15:54:34 +01:00
|
|
|
{
|
2010-10-14 09:25:30 +01:00
|
|
|
switch (attr) {
|
|
|
|
#define ATTRIB_MAP(attr, memb) case attr: return offsetof(_EGLConfig, memb)
|
|
|
|
/* core */
|
|
|
|
ATTRIB_MAP(EGL_BUFFER_SIZE, BufferSize);
|
|
|
|
ATTRIB_MAP(EGL_ALPHA_SIZE, AlphaSize);
|
|
|
|
ATTRIB_MAP(EGL_BLUE_SIZE, BlueSize);
|
|
|
|
ATTRIB_MAP(EGL_GREEN_SIZE, GreenSize);
|
|
|
|
ATTRIB_MAP(EGL_RED_SIZE, RedSize);
|
|
|
|
ATTRIB_MAP(EGL_DEPTH_SIZE, DepthSize);
|
|
|
|
ATTRIB_MAP(EGL_STENCIL_SIZE, StencilSize);
|
|
|
|
ATTRIB_MAP(EGL_CONFIG_CAVEAT, ConfigCaveat);
|
|
|
|
ATTRIB_MAP(EGL_CONFIG_ID, ConfigID);
|
|
|
|
ATTRIB_MAP(EGL_LEVEL, Level);
|
|
|
|
ATTRIB_MAP(EGL_MAX_PBUFFER_HEIGHT, MaxPbufferHeight);
|
|
|
|
ATTRIB_MAP(EGL_MAX_PBUFFER_PIXELS, MaxPbufferPixels);
|
|
|
|
ATTRIB_MAP(EGL_MAX_PBUFFER_WIDTH, MaxPbufferWidth);
|
|
|
|
ATTRIB_MAP(EGL_NATIVE_RENDERABLE, NativeRenderable);
|
|
|
|
ATTRIB_MAP(EGL_NATIVE_VISUAL_ID, NativeVisualID);
|
|
|
|
ATTRIB_MAP(EGL_NATIVE_VISUAL_TYPE, NativeVisualType);
|
|
|
|
ATTRIB_MAP(EGL_SAMPLES, Samples);
|
|
|
|
ATTRIB_MAP(EGL_SAMPLE_BUFFERS, SampleBuffers);
|
|
|
|
ATTRIB_MAP(EGL_SURFACE_TYPE, SurfaceType);
|
|
|
|
ATTRIB_MAP(EGL_TRANSPARENT_TYPE, TransparentType);
|
|
|
|
ATTRIB_MAP(EGL_TRANSPARENT_BLUE_VALUE, TransparentBlueValue);
|
|
|
|
ATTRIB_MAP(EGL_TRANSPARENT_GREEN_VALUE, TransparentGreenValue);
|
|
|
|
ATTRIB_MAP(EGL_TRANSPARENT_RED_VALUE, TransparentRedValue);
|
|
|
|
ATTRIB_MAP(EGL_BIND_TO_TEXTURE_RGB, BindToTextureRGB);
|
|
|
|
ATTRIB_MAP(EGL_BIND_TO_TEXTURE_RGBA, BindToTextureRGBA);
|
|
|
|
ATTRIB_MAP(EGL_MIN_SWAP_INTERVAL, MinSwapInterval);
|
|
|
|
ATTRIB_MAP(EGL_MAX_SWAP_INTERVAL, MaxSwapInterval);
|
|
|
|
ATTRIB_MAP(EGL_LUMINANCE_SIZE, LuminanceSize);
|
|
|
|
ATTRIB_MAP(EGL_ALPHA_MASK_SIZE, AlphaMaskSize);
|
|
|
|
ATTRIB_MAP(EGL_COLOR_BUFFER_TYPE, ColorBufferType);
|
|
|
|
ATTRIB_MAP(EGL_RENDERABLE_TYPE, RenderableType);
|
|
|
|
ATTRIB_MAP(EGL_MATCH_NATIVE_PIXMAP, MatchNativePixmap);
|
|
|
|
ATTRIB_MAP(EGL_CONFORMANT, Conformant);
|
|
|
|
/* extensions */
|
|
|
|
ATTRIB_MAP(EGL_Y_INVERTED_NOK, YInvertedNOK);
|
|
|
|
#undef ATTRIB_MAP
|
2010-05-07 03:40:25 +01:00
|
|
|
default:
|
2009-09-25 15:54:34 +01:00
|
|
|
return -1;
|
2010-05-07 03:40:25 +01:00
|
|
|
}
|
2009-09-25 15:54:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update a config for a given key.
|
2010-02-05 05:33:55 +00:00
|
|
|
*
|
|
|
|
* Note that a valid key is not necessarily a valid attribute. There are gaps
|
|
|
|
* in the attribute enums. The separation is to catch application errors.
|
|
|
|
* Drivers should never set a key that is an invalid attribute.
|
2009-09-25 15:54:34 +01:00
|
|
|
*/
|
|
|
|
static INLINE void
|
|
|
|
_eglSetConfigKey(_EGLConfig *conf, EGLint key, EGLint val)
|
|
|
|
{
|
2010-10-14 09:25:30 +01:00
|
|
|
EGLint offset = _eglOffsetOfConfig(key);
|
|
|
|
assert(offset >= 0);
|
|
|
|
*((EGLint *) ((char *) conf + offset)) = val;
|
2009-09-25 15:54:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the value for a given key.
|
|
|
|
*/
|
|
|
|
static INLINE EGLint
|
|
|
|
_eglGetConfigKey(const _EGLConfig *conf, EGLint key)
|
|
|
|
{
|
2010-10-14 09:25:30 +01:00
|
|
|
EGLint offset = _eglOffsetOfConfig(key);
|
|
|
|
assert(offset >= 0);
|
|
|
|
return *((EGLint *) ((char *) conf + offset));
|
2009-09-25 15:54:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-01-05 13:39:15 +00:00
|
|
|
PUBLIC void
|
2010-01-31 06:32:31 +00:00
|
|
|
_eglInitConfig(_EGLConfig *config, _EGLDisplay *dpy, EGLint id);
|
2005-04-22 22:09:39 +01:00
|
|
|
|
|
|
|
|
2010-01-05 13:39:15 +00:00
|
|
|
PUBLIC EGLConfig
|
2010-10-22 17:47:22 +01:00
|
|
|
_eglLinkConfig(_EGLConfig *conf);
|
2008-05-27 21:33:54 +01:00
|
|
|
|
|
|
|
|
2010-10-22 17:47:22 +01:00
|
|
|
extern _EGLConfig *
|
|
|
|
_eglLookupConfig(EGLConfig config, _EGLDisplay *dpy);
|
2009-09-25 16:43:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2010-10-22 17:47:22 +01:00
|
|
|
* Return the handle of a linked config.
|
2009-09-25 16:43:49 +01:00
|
|
|
*/
|
|
|
|
static INLINE EGLConfig
|
|
|
|
_eglGetConfigHandle(_EGLConfig *conf)
|
|
|
|
{
|
2010-10-22 17:47:22 +01:00
|
|
|
return (EGLConfig) conf;
|
2009-09-25 16:43:49 +01:00
|
|
|
}
|
2005-05-04 04:33:21 +01:00
|
|
|
|
|
|
|
|
2010-01-05 13:39:15 +00:00
|
|
|
PUBLIC EGLBoolean
|
2009-09-25 16:24:03 +01:00
|
|
|
_eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching);
|
|
|
|
|
|
|
|
|
2010-01-05 13:39:15 +00:00
|
|
|
PUBLIC EGLBoolean
|
2009-09-25 16:24:03 +01:00
|
|
|
_eglMatchConfig(const _EGLConfig *conf, const _EGLConfig *criteria);
|
|
|
|
|
|
|
|
|
2010-01-05 13:39:15 +00:00
|
|
|
PUBLIC EGLBoolean
|
2010-10-22 17:47:22 +01:00
|
|
|
_eglParseConfigAttribList(_EGLConfig *conf, _EGLDisplay *dpy,
|
|
|
|
const EGLint *attrib_list);
|
2009-09-25 16:24:03 +01:00
|
|
|
|
|
|
|
|
2010-01-05 13:39:15 +00:00
|
|
|
PUBLIC EGLint
|
2009-09-25 16:24:03 +01:00
|
|
|
_eglCompareConfigs(const _EGLConfig *conf1, const _EGLConfig *conf2,
|
|
|
|
const _EGLConfig *criteria, EGLBoolean compare_id);
|
|
|
|
|
|
|
|
|
2010-01-05 13:39:15 +00:00
|
|
|
PUBLIC void
|
2009-09-25 16:24:03 +01:00
|
|
|
_eglSortConfigs(const _EGLConfig **configs, EGLint count,
|
|
|
|
EGLint (*compare)(const _EGLConfig *, const _EGLConfig *,
|
|
|
|
void *),
|
|
|
|
void *priv_data);
|
2005-04-22 22:09:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
extern EGLBoolean
|
2009-08-11 10:09:39 +01:00
|
|
|
_eglChooseConfig(_EGLDriver *drv, _EGLDisplay *dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
2005-04-22 22:09:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
extern EGLBoolean
|
2009-08-11 10:09:39 +01:00
|
|
|
_eglGetConfigAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, EGLint attribute, EGLint *value);
|
2005-04-22 22:09:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
extern EGLBoolean
|
2009-08-11 10:09:39 +01:00
|
|
|
_eglGetConfigs(_EGLDriver *drv, _EGLDisplay *dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
2005-04-22 22:09:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* EGLCONFIG_INCLUDED */
|