mesa-demos: Changes to 'debian-unstable'
debian/changelog | 7
debian/patches/configure.ac-Fix-default-behavior-of-AC_ARG_WITH-glut.patch | 52
debian/patches/egl-Remove-demos-using-EGL_MESA_screen_surface.diff | 1748 ----------
debian/patches/series | 2
4 files changed, 58 insertions(+), 1751 deletions(-)
New commits:
commit 91e8881e68d345efcff7d714f989b66802f4d8c5
Author: Andreas Boll <andreas.boll.dev@gmail.com>
Date: Fri Dec 11 10:09:00 2015 +0100
Upload to unstable.
diff --git a/debian/changelog b/debian/changelog
index 6e7138a..078ea81 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-mesa-demos (8.3.0-1) UNRELEASED; urgency=medium
+mesa-demos (8.3.0-1) unstable; urgency=medium
* New upstream release.
* Remove duplicated field "Priority" from package mesa-utils-extra.
@@ -8,7 +8,7 @@ mesa-demos (8.3.0-1) UNRELEASED; urgency=medium
* Add configure.ac-Fix-default-behavior-of-AC_ARG_WITH-glut.patch to
fix the default behavior of configure if glut isn't installed.
- -- Andreas Boll <andreas.boll.dev@gmail.com> Thu, 10 Dec 2015 13:08:32 +0100
+ -- Andreas Boll <andreas.boll.dev@gmail.com> Fri, 11 Dec 2015 10:08:53 +0100
mesa-demos (8.2.0-3) unstable; urgency=medium
commit b87cf87c3ae2ae57796a4d66ea7ca94965166120
Author: Andreas Boll <andreas.boll.dev@gmail.com>
Date: Fri Dec 11 09:59:46 2015 +0100
Add configure.ac-Fix-default-behavior-of-AC_ARG_WITH-glut.patch
Fixes the default behavior of configure if glut isn't installed.
diff --git a/debian/changelog b/debian/changelog
index 7c366d0..6e7138a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ mesa-demos (8.3.0-1) UNRELEASED; urgency=medium
* Update debian/copyright from mesa's docs/license.html and remove the
unused LGPL (src/util/glstate.[ch] got removed upstream).
* Drop unneeded egl-Remove-demos-using-EGL_MESA_screen_surface.diff.
+ * Add configure.ac-Fix-default-behavior-of-AC_ARG_WITH-glut.patch to
+ fix the default behavior of configure if glut isn't installed.
-- Andreas Boll <andreas.boll.dev@gmail.com> Thu, 10 Dec 2015 13:08:32 +0100
diff --git a/debian/patches/configure.ac-Fix-default-behavior-of-AC_ARG_WITH-glut.patch b/debian/patches/configure.ac-Fix-default-behavior-of-AC_ARG_WITH-glut.patch
new file mode 100644
index 0000000..45cb7a0
--- /dev/null
+++ b/debian/patches/configure.ac-Fix-default-behavior-of-AC_ARG_WITH-glut.patch
@@ -0,0 +1,52 @@
+From 03fcd7e0e63c39a94cc9d7c8621e3e24d6cde798 Mon Sep 17 00:00:00 2001
+From: Andreas Boll <andreas.boll.dev@gmail.com>
+Date: Thu, 10 Dec 2015 15:40:44 +0100
+Subject: [PATCH demos] configure.ac: Fix default behavior of AC_ARG_WITH(glut)
+ if glut isn't available
+
+Fixes a regression introduced in
+406248811eb0dfabf75ae9495b54529ec59cce66
+
+It wrongly sets glut_enabled=yes if glut isn't available and neither
+option --with-glut nor --without-glut was given.
+
+The default behavior in that case should be if glut is available then
+enable glut else it should disable glut.
+
+To fix this the default value of glut_enabled is set back to yes and in
+case --without-glut was given glut_enabled is set to no.
+
+Cc: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
+---
+ configure.ac | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0525b09..ddc68b5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -67,7 +67,7 @@ DEMO_CFLAGS="$DEMO_CFLAGS $GL_CFLAGS"
+ DEMO_LIBS="$DEMO_LIBS $GL_LIBS"
+
+ dnl Check for GLUT
+-glut_enabled=no
++glut_enabled=yes
+ AC_ARG_WITH([glut],
+ [AS_HELP_STRING([--with-glut=DIR],
+ [glut install directory])],
+@@ -83,9 +83,8 @@ AS_IF([test "x$with_glut" != xno],
+ AC_CHECK_LIB([glut],
+ [glutInit],
+ [],
+- [glut_enabled=no])
+- glut_enabled=yes
+-])
++ [glut_enabled=no])],
++ [glut_enabled=no])
+
+ dnl Check for FreeGLUT 2.6 or later
+ AC_EGREP_HEADER([glutInitContextProfile],
+--
+2.1.4
+
diff --git a/debian/patches/series b/debian/patches/series
index 833cff7..39ce469 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
no_eglfbdev.diff
+configure.ac-Fix-default-behavior-of-AC_ARG_WITH-glut.patch
commit 2b8f16e84e846eb432bc81d071100ca5cdc35d5f
Author: Andreas Boll <andreas.boll.dev@gmail.com>
Date: Thu Dec 10 14:04:03 2015 +0100
Drop unneeded egl-Remove-demos-using-EGL_MESA_screen_surface.diff.
diff --git a/debian/changelog b/debian/changelog
index 2e964ad..7c366d0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ mesa-demos (8.3.0-1) UNRELEASED; urgency=medium
* Remove duplicated field "Priority" from package mesa-utils-extra.
* Update debian/copyright from mesa's docs/license.html and remove the
unused LGPL (src/util/glstate.[ch] got removed upstream).
+ * Drop unneeded egl-Remove-demos-using-EGL_MESA_screen_surface.diff.
-- Andreas Boll <andreas.boll.dev@gmail.com> Thu, 10 Dec 2015 13:08:32 +0100
diff --git a/debian/patches/egl-Remove-demos-using-EGL_MESA_screen_surface.diff b/debian/patches/egl-Remove-demos-using-EGL_MESA_screen_surface.diff
deleted file mode 100644
index ee77ff6..0000000
--- a/debian/patches/egl-Remove-demos-using-EGL_MESA_screen_surface.diff
+++ /dev/null
@@ -1,1748 +0,0 @@
-From 082ae0e783cc8a4cf530fec6b6621858e8cd3f36 Mon Sep 17 00:00:00 2001
-From: Matt Turner <mattst88@gmail.com>
-Date: Fri, 28 Aug 2015 15:57:38 -0700
-Subject: [PATCH] egl: Remove demos using EGL_MESA_screen_surface.
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The remnants of the extension were removed from Mesa in commit 7a58262e.
-
-Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
-Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-(cherry picked from commit 74443c6ee79f3251f643ea05e94df58183e37d0d)
-
-Conflicts:
- src/egl/opengles2/Makefile.am
-
-Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
----
- src/egl/eglut/CMakeLists.txt | 6 -
- src/egl/eglut/Makefile.am | 10 +-
- src/egl/eglut/eglut.c | 8 +-
- src/egl/eglut/eglut_screen.c | 180 -----------
- src/egl/opengl/CMakeLists.txt | 17 -
- src/egl/opengl/Makefile.am | 11 -
- src/egl/opengl/demo1.c | 147 ---------
- src/egl/opengl/demo2.c | 216 -------------
- src/egl/opengl/demo3.c | 647 ---------------------------------------
- src/egl/opengl/eglinfo.c | 45 ---
- src/egl/opengl/eglscreen.c | 120 --------
- src/egl/opengles1/CMakeLists.txt | 4 -
- src/egl/opengles1/Makefile.am | 14 -
- src/egl/opengles2/CMakeLists.txt | 4 -
- src/egl/opengles2/Makefile.am | 5 -
- src/egl/openvg/CMakeLists.txt | 4 -
- src/egl/openvg/Makefile.am | 8 -
- 17 files changed, 5 insertions(+), 1441 deletions(-)
- delete mode 100644 src/egl/eglut/eglut_screen.c
- delete mode 100644 src/egl/opengl/demo1.c
- delete mode 100644 src/egl/opengl/demo2.c
- delete mode 100644 src/egl/opengl/demo3.c
- delete mode 100644 src/egl/opengl/eglscreen.c
-
-diff --git a/src/egl/eglut/CMakeLists.txt b/src/egl/eglut/CMakeLists.txt
-index a885977..0417b48 100644
---- a/src/egl/eglut/CMakeLists.txt
-+++ b/src/egl/eglut/CMakeLists.txt
-@@ -9,9 +9,3 @@ if (X11_FOUND)
- install (TARGETS eglut_x11 DESTINATION ${LIBDIR})
- endif (BUILD_SHARED_LIBS)
- endif (X11_FOUND)
--
--add_library (eglut_screen eglut.h eglut.c eglutint.h eglut_screen.c)
--target_link_libraries (eglut_screen ${EGL_LIBRARIES})
--if (BUILD_SHARED_LIBS)
-- install (TARGETS eglut_screen DESTINATION ${LIBDIR})
--endif (BUILD_SHARED_LIBS)
-diff --git a/src/egl/eglut/Makefile.am b/src/egl/eglut/Makefile.am
-index 2d2f2af..b765069 100644
---- a/src/egl/eglut/Makefile.am
-+++ b/src/egl/eglut/Makefile.am
-@@ -33,17 +33,12 @@ if HAVE_WAYLAND
- eglut_wayland = libeglut_wayland.la
- endif
-
--noinst_LTLIBRARIES = libeglut_screen.la $(eglut_x11) $(eglut_wayland)
-+noinst_LTLIBRARIES = $(eglut_x11) $(eglut_wayland)
- endif
-
--libeglut_screen_la_SOURCES = \
-- eglut.c \
-- eglut.h \
-- eglutint.h \
-- eglut_screen.c
--
- libeglut_x11_la_SOURCES = \
- eglut.c \
-+ eglut.h \
- eglutint.h \
- eglut_x11.c
- libeglut_x11_la_CFLAGS = $(X11_CFLAGS) $(EGL_CFLAGS)
-@@ -52,6 +47,7 @@ libeglut_x11_la_LIBADD = $(X11_LIBS) $(EGL_LIBS)
-
- libeglut_wayland_la_SOURCES = \
- eglut.c \
-+ eglut.h \
- eglutint.h \
- eglut_wayland.c
-
-diff --git a/src/egl/eglut/eglut.c b/src/egl/eglut/eglut.c
-index 2ee6f15..9921746 100644
---- a/src/egl/eglut/eglut.c
-+++ b/src/egl/eglut/eglut.c
-@@ -76,8 +76,7 @@ _eglutNow(void)
- static void
- _eglutDestroyWindow(struct eglut_window *win)
- {
-- if (_eglut->surface_type != EGL_PBUFFER_BIT &&
-- _eglut->surface_type != EGL_SCREEN_BIT_MESA)
-+ if (_eglut->surface_type != EGL_PBUFFER_BIT)
- eglDestroySurface(_eglut->dpy, win->surface);
-
- _eglutNativeFiniWindow(win);
-@@ -175,7 +174,6 @@ _eglutCreateWindow(const char *title, int x, int y, int w, int h)
- win->config, win->native.u.pixmap, NULL);
- break;
- case EGL_PBUFFER_BIT:
-- case EGL_SCREEN_BIT_MESA:
- win->surface = win->native.u.surface;
- break;
- default:
-@@ -289,9 +287,7 @@ eglutDestroyWindow(int win)
- if (window->index != win)
- return;
-
-- /* XXX it causes some bug in st/egl KMS backend */
-- if ( _eglut->surface_type != EGL_SCREEN_BIT_MESA)
-- eglMakeCurrent(_eglut->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
-+ eglMakeCurrent(_eglut->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
-
- _eglutDestroyWindow(_eglut->current);
- }
-diff --git a/src/egl/eglut/eglut_screen.c b/src/egl/eglut/eglut_screen.c
-deleted file mode 100644
-index 021a8f1..0000000
---- a/src/egl/eglut/eglut_screen.c
-+++ /dev/null
-@@ -1,180 +0,0 @@
--/*
-- * Copyright (C) 2010 LunarG Inc.
-- *
-- * Permission is hereby granted, free of charge, to any person obtaining a
-- * copy of this software and associated documentation files (the "Software"),
-- * to deal in the Software without restriction, including without limitation
-- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-- * and/or sell copies of the Software, and to permit persons to whom the
-- * Software is furnished to do so, subject to the following conditions:
-- *
-- * The above copyright notice and this permission notice shall be included
-- * in all copies or substantial portions of the Software.
-- *
-- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-- * DEALINGS IN THE SOFTWARE.
-- *
-- * Authors:
-- * Chia-I Wu <olv@lunarg.com>
-- */
--
--#include <stdio.h>
--#include <string.h>
--#include <sys/time.h>
--
--#define EGL_EGLEXT_PROTOTYPES
--#include "EGL/egl.h"
--#include "EGL/eglext.h"
--
--#include "eglutint.h"
--
--#define MAX_MODES 100
--
--static EGLScreenMESA kms_screen;
--static EGLModeMESA kms_mode;
--static EGLint kms_width, kms_height;
--
--void
--_eglutNativeInitDisplay(void)
--{
-- _eglut->native_dpy = EGL_DEFAULT_DISPLAY;
-- _eglut->surface_type = EGL_SCREEN_BIT_MESA;
--}
--
--void
--_eglutNativeFiniDisplay(void)
--{
-- kms_screen = 0;
-- kms_mode = 0;
-- kms_width = 0;
-- kms_height = 0;
--}
--
--static void
--init_kms(void)
--{
-- EGLModeMESA modes[MAX_MODES];
-- EGLint num_screens, num_modes;
-- EGLint width, height, best_mode;
-- EGLint i;
--
-- if (!eglGetScreensMESA(_eglut->dpy, &kms_screen, 1, &num_screens) ||
-- !num_screens)
-- _eglutFatal("eglGetScreensMESA failed\n");
--
-- if (!eglGetModesMESA(_eglut->dpy, kms_screen,
-- modes, MAX_MODES, &num_modes) || !num_modes)
-- _eglutFatal("eglGetModesMESA failed!\n");
--
-- printf("Found %d modes:\n", num_modes);
--
-- best_mode = 0;
-- width = 0;
-- height = 0;
-- for (i = 0; i < num_modes; i++) {
-- EGLint w, h;
-- eglGetModeAttribMESA(_eglut->dpy, modes[i], EGL_WIDTH, &w);
-- eglGetModeAttribMESA(_eglut->dpy, modes[i], EGL_HEIGHT, &h);
-- printf("%3d: %d x %d\n", i, w, h);
-- if (w > width && h > height) {
-- width = w;
-- height = h;
-- best_mode = i;
-- }
-- }
--
-- printf("Will use screen size: %d x %d\n", width, height);
--
-- kms_mode = modes[best_mode];
-- kms_width = width;
-- kms_height = height;
--}
--
--void
--_eglutNativeInitWindow(struct eglut_window *win, const char *title,
-- int x, int y, int w, int h)
--{
-- EGLint surf_attribs[16];
-- EGLint i;
-- const char *exts;
--
-- exts = eglQueryString(_eglut->dpy, EGL_EXTENSIONS);
-- if (!exts || !strstr(exts, "EGL_MESA_screen_surface"))
-- _eglutFatal("EGL_MESA_screen_surface is not supported\n");
--
-- init_kms();
--
-- i = 0;
-- surf_attribs[i++] = EGL_WIDTH;
-- surf_attribs[i++] = kms_width;
-- surf_attribs[i++] = EGL_HEIGHT;
-- surf_attribs[i++] = kms_height;
-- surf_attribs[i++] = EGL_NONE;
--
-- /* create surface */
-- win->native.u.surface = eglCreateScreenSurfaceMESA(_eglut->dpy,
-- win->config, surf_attribs);
-- if (win->native.u.surface == EGL_NO_SURFACE)
-- _eglutFatal("eglCreateScreenSurfaceMESA failed\n");
--
-- if (!eglShowScreenSurfaceMESA(_eglut->dpy, kms_screen,
-- win->native.u.surface, kms_mode))
-- _eglutFatal("eglShowScreenSurfaceMESA failed\n");
--
-- win->native.width = kms_width;
-- win->native.height = kms_height;
--}
--
--void
--_eglutNativeFiniWindow(struct eglut_window *win)
--{
-- eglShowScreenSurfaceMESA(_eglut->dpy,
-- kms_screen, EGL_NO_SURFACE, 0);
-- eglDestroySurface(_eglut->dpy, win->native.u.surface);
--}
--
--void
--_eglutNativeEventLoop(void)
--{
-- int start = _eglutNow();
-- int frames = 0;
--
-- _eglut->redisplay = 1;
--
-- while (1) {
-- struct eglut_window *win = _eglut->current;
-- int now = _eglutNow();
--
-- if (now - start > 5000) {
-- double elapsed = (double) (now - start) / 1000.0;
--
-- printf("%d frames in %3.1f seconds = %6.3f FPS\n",
-- frames, elapsed, frames / elapsed);
-- fflush(stdout);
--
-- start = now;
-- frames = 0;
--
-- /* send escape */
-- if (win->keyboard_cb)
-- win->keyboard_cb(27);
-- }
--
-- if (_eglut->idle_cb)
-- _eglut->idle_cb();
--
-- if (_eglut->redisplay) {
-- _eglut->redisplay = 0;
--
-- if (win->display_cb)
-- win->display_cb();
-- eglSwapBuffers(_eglut->dpy, win->surface);
-- frames++;
-- }
-- }
--}
-diff --git a/src/egl/opengl/CMakeLists.txt b/src/egl/opengl/CMakeLists.txt
-index 04fb6dd..dd726b7 100644
---- a/src/egl/opengl/CMakeLists.txt
-+++ b/src/egl/opengl/CMakeLists.txt
-@@ -12,19 +12,6 @@ link_libraries (
-
- set (subdir egl)
-
--set (targets
-- demo1
-- demo2
-- demo3
--)
--
--foreach (target ${targets})
-- add_executable (${subdir}_${target} ${target}.c)
-- set_target_properties (${subdir}_${target} PROPERTIES OUTPUT_NAME ${target})
-- install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
--endforeach (target)
--
--
- # Targets that can be built both for fullscreen EGL and X11
-
- set (targets
-@@ -33,10 +20,6 @@ set (targets
- )
-
- foreach (target ${targets})
-- add_executable (${target}_screen ${target}.c)
-- target_link_libraries (${target}_screen eglut_screen)
-- install (TARGETS ${target}_screen DESTINATION ${subdir})
--
- if (X11_FOUND)
- add_executable (${target}_x11 ${target}.c)
- target_link_libraries (${target}_x11 eglut_x11)
-diff --git a/src/egl/opengl/Makefile.am b/src/egl/opengl/Makefile.am
-index 0c7228f..fe7faa9 100644
---- a/src/egl/opengl/Makefile.am
-+++ b/src/egl/opengl/Makefile.am
-@@ -51,20 +51,12 @@ endif
-
- if HAVE_EGL
- noinst_PROGRAMS = \
-- demo1 \
-- demo2 \
-- demo3 \
- eglinfo \
-- eglgears_screen \
-- egltri_screen \
- peglgears \
- $(EGL_DRM_DEMOS) \
- $(EGL_X11_DEMOS)
- endif
-
--egltri_screen_SOURCES = egltri.c
--eglgears_screen_SOURCES = eglgears.c
--
- egltri_x11_SOURCES = egltri.c
- eglgears_x11_SOURCES = eglgears.c
-
-@@ -73,9 +65,6 @@ egltri_x11_LDFLAGS = $(AM_LDFLAGS) $(X11_LIBS)
- xeglgears_LDFLAGS = $(AM_LDFLAGS) $(X11_LIBS)
- xeglthreads_LDFLAGS = $(AM_LDFLAGS) $(X11_LIBS) -pthread
-
--eglgears_screen_LDADD = ../eglut/libeglut_screen.la
--egltri_screen_LDADD = ../eglut/libeglut_screen.la
--
- eglgears_x11_LDADD = ../eglut/libeglut_x11.la
- egltri_x11_LDADD = ../eglut/libeglut_x11.la
-
-diff --git a/src/egl/opengl/demo1.c b/src/egl/opengl/demo1.c
-deleted file mode 100644
-index d892734..0000000
---- a/src/egl/opengl/demo1.c
-+++ /dev/null
-@@ -1,147 +0,0 @@
--/*
-- * Exercise EGL API functions
-- */
--
--#define EGL_EGLEXT_PROTOTYPES
--
--#include <EGL/egl.h>
--#include <EGL/eglext.h>
--#include <assert.h>
--#include <stdio.h>
--#include <stdlib.h>
--#include <string.h>
--
--
--/**
-- * Test EGL_MESA_screen_surface functions
-- */
--static void
--TestScreens(EGLDisplay dpy)
--{
--#define MAX 8
-- EGLScreenMESA screens[MAX];
-- EGLint numScreens;
-- EGLint i;
--
-- eglGetScreensMESA(dpy, screens, MAX, &numScreens);
-- printf("Found %d screens\n", numScreens);
-- for (i = 0; i < numScreens; i++) {
-- printf(" Screen %d handle: %d\n", i, (int) screens[i]);
-- }
--}
--
--/**
-- * Print table of all available configurations.
-- */
--static void
--PrintConfigs(EGLDisplay d, EGLConfig *configs, EGLint numConfigs)
--{
-- EGLint i;
--
-- printf("Configurations:\n");
-- printf(" bf lv d st colorbuffer dp st supported \n");
-- printf(" id sz l b ro r g b a th cl surfaces \n");
-- printf("----------------------------------------------\n");
-- for (i = 0; i < numConfigs; i++) {
-- EGLint id, size, level;
-- EGLint red, green, blue, alpha;
-- EGLint depth, stencil;
-- EGLint surfaces;
-- EGLint doubleBuf = 1, stereo = 0;
-- char surfString[100] = "";
--
-- eglGetConfigAttrib(d, configs[i], EGL_CONFIG_ID, &id);
-- eglGetConfigAttrib(d, configs[i], EGL_BUFFER_SIZE, &size);
-- eglGetConfigAttrib(d, configs[i], EGL_LEVEL, &level);
--
-- eglGetConfigAttrib(d, configs[i], EGL_RED_SIZE, &red);
-- eglGetConfigAttrib(d, configs[i], EGL_GREEN_SIZE, &green);
-- eglGetConfigAttrib(d, configs[i], EGL_BLUE_SIZE, &blue);
-- eglGetConfigAttrib(d, configs[i], EGL_ALPHA_SIZE, &alpha);
-- eglGetConfigAttrib(d, configs[i], EGL_DEPTH_SIZE, &depth);
-- eglGetConfigAttrib(d, configs[i], EGL_STENCIL_SIZE, &stencil);
-- eglGetConfigAttrib(d, configs[i], EGL_SURFACE_TYPE, &surfaces);
--
-- if (surfaces & EGL_WINDOW_BIT)
-- strcat(surfString, "win,");
-- if (surfaces & EGL_PBUFFER_BIT)
-- strcat(surfString, "pb,");
-- if (surfaces & EGL_PIXMAP_BIT)
-- strcat(surfString, "pix,");
-- if (strlen(surfString) > 0)
-- surfString[strlen(surfString) - 1] = 0;
--
-- printf("0x%02x %2d %2d %c %c %2d %2d %2d %2d %2d %2d %-12s\n",
-- id, size, level,
-- doubleBuf ? 'y' : '.',
-- stereo ? 'y' : '.',
-- red, green, blue, alpha,
-- depth, stencil, surfString);
-- }
--}
--
--
--
--int
--main(int argc, char *argv[])
--{
-- int maj, min;
-- EGLContext ctx;
-- EGLSurface pbuffer;
-- EGLConfig *configs;
-- EGLint numConfigs;
-- EGLBoolean b;
-- const EGLint pbufAttribs[] = {
-- EGL_WIDTH, 500,
-- EGL_HEIGHT, 500,
-- EGL_NONE
-- };
--
-- EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
-- assert(d);
--
-- if (!eglInitialize(d, &maj, &min)) {
-- printf("demo: eglInitialize failed\n");
-- exit(1);
-- }
--
-- printf("EGL version = %d.%d\n", maj, min);
-- printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
--
-- eglGetConfigs(d, NULL, 0, &numConfigs);
-- configs = malloc(sizeof(*configs) *numConfigs);
-- eglGetConfigs(d, configs, numConfigs, &numConfigs);
--
-- PrintConfigs(d, configs, numConfigs);
--
-- eglBindAPI(EGL_OPENGL_API);
-- ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
-- if (ctx == EGL_NO_CONTEXT) {
-- printf("failed to create context\n");
-- return 0;
-- }
--
-- pbuffer = eglCreatePbufferSurface(d, configs[0], pbufAttribs);
-- if (pbuffer == EGL_NO_SURFACE) {
-- printf("failed to create pbuffer\n");
-- return 0;
-- }
--
-- free(configs);
--
-- b = eglMakeCurrent(d, pbuffer, pbuffer, ctx);
-- if (!b) {
-- printf("make current failed\n");
-- return 0;
-- }
--
-- b = eglMakeCurrent(d, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
--
-- TestScreens(d);
--
-- eglDestroySurface(d, pbuffer);
-- eglDestroyContext(d, ctx);
-- eglTerminate(d);
--
-- return 0;
--}
-diff --git a/src/egl/opengl/demo2.c b/src/egl/opengl/demo2.c
-deleted file mode 100644
-index 505b474..0000000
---- a/src/egl/opengl/demo2.c
-+++ /dev/null
-@@ -1,216 +0,0 @@
--/*
-- * Exercise EGL API functions
-- */
--
--#define EGL_EGLEXT_PROTOTYPES
--
--#include <assert.h>
--#include <stdio.h>
--#include <stdlib.h>
--#include <string.h>
--#include <unistd.h>
--
--#include <EGL/egl.h>
--#include <EGL/eglext.h>
--#include "gl_wrap.h"
--
--/*#define FRONTBUFFER*/
--
--static void _subset_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2,
-- GLfloat r, GLfloat g, GLfloat b)
--{
-- GLfloat v[4][2], c[4][4];
-- int i;
--
-- v[0][0] = x1; v[0][1] = y1;
-- v[1][0] = x2; v[1][1] = y1;
-- v[2][0] = x2; v[2][1] = y2;
-- v[3][0] = x1; v[3][1] = y2;
--
-- for (i = 0; i < 4; i++) {
-- c[i][0] = r;
-- c[i][1] = g;
-- c[i][2] = b;
-- c[i][3] = 1.0;
-- }
--
-- glVertexPointer(2, GL_FLOAT, 0, v);
-- glColorPointer(4, GL_FLOAT, 0, c);
-- glEnableClientState(GL_VERTEX_ARRAY);
-- glEnableClientState(GL_COLOR_ARRAY);
--
-- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
--
-- glDisableClientState(GL_VERTEX_ARRAY);
-- glDisableClientState(GL_COLOR_ARRAY);
--}
--
--
--static void redraw(EGLDisplay dpy, EGLSurface surf, int rot)
--{
-- GLfloat r, g, b;
--
-- printf("Redraw event\n");
--
-- glClearColor( rand()/(float)RAND_MAX,
-- rand()/(float)RAND_MAX,
-- rand()/(float)RAND_MAX,
-- 1);
--
-- glClear( GL_COLOR_BUFFER_BIT );
--
-- r = rand()/(float)RAND_MAX;
-- g = rand()/(float)RAND_MAX;
-- b = rand()/(float)RAND_MAX;
--
-- glPushMatrix();
-- glRotatef(rot, 0, 0, 1);
-- glScalef(.5, .5, .5);
-- _subset_Rectf( -1, -1, 1, 1, r, g, b );
-- glPopMatrix();
--
--#ifdef FRONTBUFFER
-- glFlush();
--#else
-- eglSwapBuffers( dpy, surf );
--#endif
-- glFinish();
--}
--
--
--/**
-- * Test EGL_MESA_screen_surface functions
-- */
--static void
--TestScreens(EGLDisplay dpy)
--{
--#define MAX 8
-- EGLScreenMESA screens[MAX];
-- EGLint numScreens;
-- EGLint i;
--
-- eglGetScreensMESA(dpy, screens, MAX, &numScreens);
-- printf("Found %d screens\n", numScreens);
-- for (i = 0; i < numScreens; i++) {
-- printf(" Screen %d handle: %d\n", i, (int) screens[i]);
-- }
--}
--
--
--int
--main(int argc, char *argv[])
--{
-- int maj, min;
-- EGLContext ctx;
-- EGLSurface pbuffer, screen_surf;
-- EGLConfig configs[10];
-- EGLint numConfigs, i;
-- EGLBoolean b;
-- const EGLint pbufAttribs[] = {
-- EGL_WIDTH, 500,
-- EGL_HEIGHT, 500,
-- EGL_NONE
-- };
-- EGLint screenAttribs[32];
-- EGLModeMESA mode;
-- EGLScreenMESA screen;
-- EGLint count;
--
-- EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
-- assert(d);
--
-- if (!eglInitialize(d, &maj, &min)) {
-- printf("demo: eglInitialize failed\n");
-- exit(1);
-- }
--
-- printf("EGL version = %d.%d\n", maj, min);
-- printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
-- if (!strstr(eglQueryString(d, EGL_EXTENSIONS),
-- "EGL_MESA_screen_surface")) {
-- printf("EGL_MESA_screen_surface is not supported\n");
-- exit(1);
-- }
--
-- eglGetConfigs(d, configs, 10, &numConfigs);
-- printf("Got %d EGL configs:\n", numConfigs);
-- for (i = 0; i < numConfigs; i++) {
-- EGLint id, red, depth;
-- eglGetConfigAttrib(d, configs[i], EGL_CONFIG_ID, &id);
-- eglGetConfigAttrib(d, configs[i], EGL_RED_SIZE, &red);
-- eglGetConfigAttrib(d, configs[i], EGL_DEPTH_SIZE, &depth);
-- printf("%2d: Red Size = %d Depth Size = %d\n", id, red, depth);
-- }
--
-- eglGetScreensMESA(d, &screen, 1, &count);
-- eglGetModesMESA(d, screen, &mode, 1, &count);
--
-- eglBindAPI(EGL_OPENGL_API);
-- ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
-- if (ctx == EGL_NO_CONTEXT) {
-- printf("failed to create context\n");
-- return 0;
-- }
--
-- pbuffer = eglCreatePbufferSurface(d, configs[0], pbufAttribs);
-- if (pbuffer == EGL_NO_SURFACE) {
-- printf("failed to create pbuffer\n");
-- return 0;
-- }
--
-- b = eglMakeCurrent(d, pbuffer, pbuffer, ctx);
-- if (!b) {
-- printf("make current failed\n");
-- return 0;
-- }
--
-- b = eglMakeCurrent(d, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
--
-- i = 0;
-- screenAttribs[i++] = EGL_WIDTH;
-- eglGetModeAttribMESA(d, mode, EGL_WIDTH, &screenAttribs[i++]);
-- screenAttribs[i++] = EGL_HEIGHT;
-- eglGetModeAttribMESA(d, mode, EGL_HEIGHT, &screenAttribs[i++]);
-- screenAttribs[i] = EGL_NONE;
--
-- screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs);
-- if (screen_surf == EGL_NO_SURFACE) {
-- printf("failed to create screen surface\n");
-- return 0;
-- }
--
-- eglShowScreenSurfaceMESA(d, screen, screen_surf, mode);
--
-- b = eglMakeCurrent(d, screen_surf, screen_surf, ctx);
-- if (!b) {
-- printf("make current failed\n");
-- return 0;
-- }
--
-- glViewport(0, 0, 1024, 768);
--
-- glClearColor( 0,
-- 1.0,
-- 0,
-- 1);
--
-- glClear( GL_COLOR_BUFFER_BIT );
--
--
-- TestScreens(d);
--
-- glShadeModel( GL_FLAT );
--
-- for (i = 0; i < 6; i++) {
-- redraw(d, screen_surf, i*10 );
--
-- printf("sleep(1)\n");
-- sleep(1);
-- }
--
-- eglDestroySurface(d, pbuffer);
-- eglDestroyContext(d, ctx);
-- eglTerminate(d);
--
-- return 0;
--}
-diff --git a/src/egl/opengl/demo3.c b/src/egl/opengl/demo3.c
-deleted file mode 100644
-index f84ca23..0000000
---- a/src/egl/opengl/demo3.c
-+++ /dev/null
-@@ -1,647 +0,0 @@
--/*
-- * Exercise EGL API functions
-- */
--
--#define EGL_EGLEXT_PROTOTYPES
--
--#include <EGL/egl.h>
--#include <EGL/eglext.h>
--#include "gl_wrap.h"
--#include <assert.h>
--#include <stdio.h>
--#include <stdlib.h>
--#include <string.h>
--#include <unistd.h>
--
--
--
--#define PIXEL_CENTER(x) ((long)(x) + 0.5)
--
--#define GAP 10
--#define ROWS 3
--#define COLS 4
--
--#define OPENGL_WIDTH 48
--#define OPENGL_HEIGHT 13
--
--
--GLenum rgb, doubleBuffer, windType;
--GLint windW, windH;
--
--GLenum mode1, mode2;
--GLint boxW, boxH;
--GLubyte OpenGL_bits[] = {
-- 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
-- 0x7f, 0xfb, 0xff, 0xff, 0xff, 0x01,
-- 0x7f, 0xfb, 0xff, 0xff, 0xff, 0x01,
-- 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
-- 0x3e, 0x8f, 0xb7, 0xf9, 0xfc, 0x01,
-- 0x63, 0xdb, 0xb0, 0x8d, 0x0d, 0x00,
-- 0x63, 0xdb, 0xb7, 0x8d, 0x0d, 0x00,
-- 0x63, 0xdb, 0xb6, 0x8d, 0x0d, 0x00,
-- 0x63, 0x8f, 0xf3, 0xcc, 0x0d, 0x00,
-- 0x63, 0x00, 0x00, 0x0c, 0x4c, 0x0a,
-- 0x63, 0x00, 0x00, 0x0c, 0x4c, 0x0e,
-- 0x63, 0x00, 0x00, 0x8c, 0xed, 0x0e,
-- 0x3e, 0x00, 0x00, 0xf8, 0x0c, 0x00,
--};
--
--
--static void Init(void)
--{
--
-- mode1 = GL_TRUE;
-- mode2 = GL_TRUE;
--}
--
--static void Reshape(int width, int height)
--{
--
-- windW = (GLint)width;
-- windH = (GLint)height;
--}
--
--#if 0
--static void RotateColorMask(void)
--{
-- static GLint rotation = 0;
--
-- rotation = (rotation + 1) & 0x3;
-- switch (rotation) {
-- case 0:
-- glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
-- glIndexMask( 0xff );
-- break;
-- case 1:
-- glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_TRUE);
-- glIndexMask(0xFE);
-- break;
-- case 2:
-- glColorMask(GL_TRUE, GL_FALSE, GL_TRUE, GL_TRUE);
-- glIndexMask(0xFD);
-- break;
-- case 3:
-- glColorMask(GL_TRUE, GL_TRUE, GL_FALSE, GL_TRUE);
-- glIndexMask(0xFB);
-- break;
-- }
--}
--#endif
--
--static void Viewport(GLint row, GLint column)
--{
-- GLint x, y;
--
-- boxW = (windW - (COLS + 1) * GAP) / COLS;
-- boxH = (windH - (ROWS + 1) * GAP) / ROWS;
Reply to: