summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglconfig.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-05-04 03:33:21 +0000
committerBrian Paul <[email protected]>2005-05-04 03:33:21 +0000
commitc22990c29a5cdff89e6e3914aa565acc88a6a407 (patch)
tree5f8d766790274560d6e5be12c75877480beb798d /src/egl/main/eglconfig.c
parent3aeae2068510a369ba5c90ae1355d0b0ed89d5f5 (diff)
sync with latest EGL_MESA_screen_surface spec (EGLScreenMESA handles)
Diffstat (limited to 'src/egl/main/eglconfig.c')
-rw-r--r--src/egl/main/eglconfig.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c
index 765e2e3dbeb..0fb7e260723 100644
--- a/src/egl/main/eglconfig.c
+++ b/src/egl/main/eglconfig.c
@@ -1,3 +1,4 @@
+#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "eglconfig.h"
@@ -51,6 +52,31 @@ _eglLookupConfig(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config)
}
+/**
+ * Add the given _EGLConifg to the given display.
+ */
+_EGLConfig *
+_eglAddConfig(_EGLDisplay *display, const _EGLConfig *config)
+{
+ _EGLConfig *newConfigs;
+ EGLint n;
+
+ n = display->NumConfigs;
+
+ newConfigs = (_EGLConfig *) realloc(display->Configs,
+ (n + 1) * sizeof(_EGLConfig));
+ if (newConfigs) {
+ display->Configs = newConfigs;
+ display->Configs[n] = *config; /* copy struct */
+ display->NumConfigs++;
+ return display->Configs + n;
+ }
+ else {
+ return NULL;
+ }
+}
+
+
/**
* Parse the attrib_list to fill in the fields of the given _egl_config