]> git.cworth.org Git - fips/commitdiff
test: Add 4 tests using EGL and OpenGLESv2
authorCarl Worth <cworth@cworth.org>
Tue, 2 Jul 2013 20:07:40 +0000 (13:07 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 3 Jul 2013 00:37:49 +0000 (17:37 -0700)
These are similar variants to the four existing tests using EGL and OpenGL.

To add these tests we add a new configure-time check to find the
compilation flags for GLESv2. We also drop the set_2d_projection code
which was using glLoadIdentity, glMatrixMode, and glOrtho functions
which apparently don't exist in GLESv2. So common.s and all tests with
custom wrappers are modified to drop these calls.

As with the egl-opengl tests, all new tests except for the dlsym-based
test pass. That's not too surprising since there are so many twisty
paths in trying to get all the dlopen/dlsym stuff to work correctly.

And hurrah for test suites finding bugs!

17 files changed:
configure
test/.gitignore
test/Makefile.local
test/common.c
test/egl-glesv2-dlopen-dlsym.c [new file with mode: 0644]
test/egl-glesv2-dlopen-gpa.c [new file with mode: 0644]
test/egl-glesv2-link-call.c [new file with mode: 0644]
test/egl-glesv2-link-gpa.c [new file with mode: 0644]
test/egl-opengl-dlopen-dlsym.c
test/egl-opengl-dlopen-gpa.c
test/egl-opengl-link-gpa.c
test/fips-test
test/glx-dlopen-dlsym.c
test/glx-dlopen-gpa.c
test/glx-dlopen-gpaa.c
test/glx-link-gpa.c
test/glx-link-gpaa.c

index 77fedba4fb0e8f088e9ae05b2c148342067ba84f..baa38a0319e30e4df14d1dab82251f926ea5418f 100755 (executable)
--- a/configure
+++ b/configure
@@ -326,7 +326,17 @@ if pkg-config --exists egl; then
     egl_ldflags=$(pkg-config --libs egl)
 else
     printf "No.\n"
-    have_egl=No
+fi
+
+printf "       Checking for GLESv2... "
+have_glesv2=No
+if pkg-config --exists glesv2; then
+    printf "Yes.\n"
+    have_glesv2=Yes
+    glesv2_cflags=$(pkg-config --cflags glesv2)
+    glesv2_ldflags=$(pkg-config --libs glesv2)
+else
+    printf "No.\n"
 fi
 
 printf "int main(void){return 0;}\n" > minimal.c
@@ -528,10 +538,10 @@ HAVE_GLX = ${have_glx}
 GL_CFLAGS = ${gl_cflags}
 GL_LDFLAGS = ${gl_ldflags}
 
-# Wheter X11 headers and library are available
+# Whether X11 headers and library are available
 HAVE_X11 = ${have_x11}
 
-# Flags needs to compile and link against libX11
+# Flags needed to compile and link against libX11
 X11_CLFLAGS = ${x11_cflags}
 X11_LDFLAGS = ${x11_ldflags}
 
@@ -542,6 +552,13 @@ HAVE_EGL = ${have_egl}
 EGL_CFLAGS = ${egl_cflags}
 EGL_LDFLAGS = ${egl_ldflags}
 
+# Whether GLESv2 headers and library are available
+HAVE_GLESV2 = ${have_glesv2}
+
+# Flags needed to compile and link against GLESv2
+GLESV2_CFLAGS = ${glesv2_cflags}
+GLESV2_LDFLAGS = ${glesv2_ldflags}
+
 # Flags needed to have linker link only to necessary libraries
 AS_NEEDED_LDFLAGS = ${as_needed_ldflags}
 EOF
index 30ae1564c138ce8e1e9d0bd24c258899297f283d..be96a44adbbe0795267a680fc3b3bba12ecdeded 100644 (file)
@@ -8,4 +8,8 @@ egl-opengl-link-call
 egl-opengl-link-gpa
 egl-opengl-dlopen-dlsym
 egl-opengl-dlopen-gpa
+egl-glesv2-link-call
+egl-glesv2-link-gpa
+egl-glesv2-dlopen-dlsym
+egl-glesv2-dlopen-gpa
 
index 6274e4f0be288a70513fed39797b79e3d5a2eb8a..c1314155d804bbb97cd9f0dfbe84f490d9960087 100644 (file)
@@ -17,6 +17,10 @@ test_programs += $(dir)/egl-opengl-link-call
 test_programs += $(dir)/egl-opengl-link-gpa
 test_programs += $(dir)/egl-opengl-dlopen-dlsym
 test_programs += $(dir)/egl-opengl-dlopen-gpa
+test_programs += $(dir)/egl-glesv2-link-call
+test_programs += $(dir)/egl-glesv2-link-gpa
+test_programs += $(dir)/egl-glesv2-dlopen-dlsym
+test_programs += $(dir)/egl-glesv2-dlopen-gpa
 endif
 
 glx_link_call_srcs = \
@@ -109,6 +113,42 @@ egl_opengl_dlopen_gpa_modules = $(egl_opengl_dlopen_gpa_srcs:.c=.o)
 $(dir)/egl-opengl-dlopen-gpa: $(egl_opengl_dlopen_gpa_modules)
        $(call quiet,$(FIPS_LINKER) $(CFLAGS)) $^ -ldl $(X11_LDFLAGS) -o $@
 
+egl_glesv2_link_call_srcs = \
+       $(dir)/egl-glesv2-link-call.c \
+       $(dir)/util-x11.c
+
+egl_glesv2_link_call_modules = $(egl_glesv2_link_call_srcs:.c=.o)
+
+$(dir)/egl-glesv2-link-call: $(egl_glesv2_link_call_modules)
+       $(call quiet,$(FIPS_LINKER) $(CFLAGS)) $^ $(EGL_LDFLAGS) $(GLESV2_LDFLAGS) $(X11_LDFLAGS) -o $@
+
+egl_glesv2_link_gpa_srcs = \
+       $(dir)/egl-glesv2-link-gpa.c \
+       $(dir)/util-x11.c
+
+egl_glesv2_link_gpa_modules = $(egl_glesv2_link_gpa_srcs:.c=.o)
+
+$(dir)/egl-glesv2-link-gpa: $(egl_glesv2_link_gpa_modules)
+       $(call quiet,$(FIPS_LINKER) $(CFLAGS)) $^ $(EGL_LDFLAGS) $(GLESV2_LDFLAGS) $(X11_LDFLAGS) -o $@
+
+egl_glesv2_dlopen_dlsym_srcs = \
+       $(dir)/egl-glesv2-dlopen-dlsym.c \
+       $(dir)/util-x11.c
+
+egl_glesv2_dlopen_dlsym_modules = $(egl_glesv2_dlopen_dlsym_srcs:.c=.o)
+
+$(dir)/egl-glesv2-dlopen-dlsym: $(egl_glesv2_dlopen_dlsym_modules)
+       $(call quiet,$(FIPS_LINKER) $(CFLAGS)) $^ -ldl $(X11_LDFLAGS) -o $@
+
+egl_glesv2_dlopen_gpa_srcs = \
+       $(dir)/egl-glesv2-dlopen-gpa.c \
+       $(dir)/util-x11.c
+
+egl_glesv2_dlopen_gpa_modules = $(egl_glesv2_dlopen_gpa_srcs:.c=.o)
+
+$(dir)/egl-glesv2-dlopen-gpa: $(egl_glesv2_dlopen_gpa_modules)
+       $(call quiet,$(FIPS_LINKER) $(CFLAGS)) $^ -ldl $(X11_LDFLAGS) -o $@
+
 test: all $(test_programs)
        @${dir}/fips-test
 
@@ -123,7 +163,11 @@ SRCS := $(SRCS) \
        $(egl_opengl_link_call_srcs) \
        $(egl_opengl_link_gpa_srcs) \
        $(egl_opengl_dlopen_dlsym_srcs) \
-       $(egl_opengl_dlopen_gpa_srcs)
+       $(egl_opengl_dlopen_gpa_srcs) \
+       $(egl_glesv2_link_call_srcs) \
+       $(egl_glesv2_link_gpa_srcs) \
+       $(egl_glesv2_dlopen_dlsym_srcs) \
+       $(egl_glesv2_dlopen_gpa_srcs)
 
 CLEAN += $(test_programs) \
        $(glx_link_call_modules) \
@@ -134,4 +178,8 @@ CLEAN += $(test_programs) \
        $(egl_opengl_link_call_modules) \
        $(egl_opengl_link_gpa_modules) \
        $(egl_opengl_dlopen_dlsym_modules) \
-       $(egl_opengl_dlopen_dlsym_modules)
+       $(egl_opengl_dlopen_dlsym_modules) \
+       $(egl_glesv2_link_call_modules) \
+       $(egl_glesv2_link_gpa_modules) \
+       $(egl_glesv2_dlopen_dlsym_modules) \
+       $(egl_glesv2_dlopen_dlsym_modules)
index 1eecc18dda88b3bf968505a441acb8c674ab5e5f..dccc9099a6753d27db774c7c2fc2a96cb96fcd20 100644 (file)
 #define _(func) concat(COMMON_GL_PREFIX, func)
 #define _E(func) concat(COMMON_EGL_PREFIX, func)
 
-static void
-set_2d_projection (int width, int height)
-{
-       _(glMatrixMode) (GL_PROJECTION);
-       _(glLoadIdentity) ();
-       _(glOrtho) (0, width, height, 0, 0, 1);
-       _(glMatrixMode) (GL_MODELVIEW);
-}
-
 static void
 paint_rgb_using_clear (double r, double g, double b)
 {
@@ -125,9 +116,14 @@ common_create_egl_context (Display *dpy, EGLenum api, EGLDisplay *egl_dpy_ret,
        int num_configs;
        EGLint major, minor;
        EGLBoolean success;
-       int context_attr[] = {
+       int opengl_context_attr[] = {
                EGL_NONE
        };
+       int glesv2_context_attr[] = {
+               EGL_CONTEXT_CLIENT_VERSION, 2,
+               EGL_NONE
+       };
+       int *context_attr;
        EGLContext ctx;
        XVisualInfo *visual_info, visual_attr;
        int visualid, num_visuals;
@@ -161,6 +157,10 @@ common_create_egl_context (Display *dpy, EGLenum api, EGLDisplay *egl_dpy_ret,
 
        _E(eglBindAPI) (api);
 
+       if (api == EGL_OPENGL_ES_API)
+               context_attr = glesv2_context_attr;
+       else
+               context_attr = opengl_context_attr;
        ctx = _E(eglCreateContext) (egl_dpy, config, NULL, context_attr);
        if (!ctx) {
                fprintf (stderr, "Error: Failed to create EGL context\n");
@@ -216,8 +216,6 @@ draw (COMMON_SWAP_DISPLAY dpy, COMMON_SWAP_WINDOW window, int width, int height)
        int i;
         _(glViewport) (0, 0, width, height);
 
-       set_2d_projection (width, height);
-
 /* Simply count through some colors, frame by frame. */
 #define RGB(frame) (((frame+1)/4) % 2), (((frame+1)/2) % 2), ((frame+1) % 2)
 
diff --git a/test/egl-glesv2-dlopen-dlsym.c b/test/egl-glesv2-dlopen-dlsym.c
new file mode 100644 (file)
index 0000000..2488d11
--- /dev/null
@@ -0,0 +1,195 @@
+/* Copyright © 2013, Intel Corporation
+ *
+ * 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.
+ */
+
+/* Perform some simple drawing via OpenGL as follows:
+ *
+ *     1. Using EGL to construct an OpenGLESv2 context
+ *     2. By using dlopen to dynamically load libGLESv2.so and libEGL.so
+ *     3. By using dlsym to lookup OpenGL functions
+ */
+
+#define GL_GLEXT_PROTOTYPES
+#include <GLES2/gl2.h>
+#include <EGL/egl.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+
+#include "util-x11.h"
+
+EGLBoolean (*my_eglBindAPI)(EGLenum);
+EGLBoolean (*my_eglChooseConfig)(EGLDisplay, EGLint const *, EGLConfig *, EGLint, EGLint *);
+EGLContext (*my_eglCreateContext)(EGLDisplay, EGLConfig, EGLContext, EGLint const *);
+EGLSurface (*my_eglCreateWindowSurface)(EGLDisplay, EGLConfig, NativeWindowType, EGLint const *);
+EGLBoolean (*my_eglGetConfigAttrib)(EGLDisplay, EGLConfig, EGLint, EGLint *);
+EGLDisplay (*my_eglGetDisplay)(NativeDisplayType);
+EGLBoolean (*my_eglInitialize)(EGLDisplay, EGLint *, EGLint *);
+EGLBoolean (*my_eglMakeCurrent)(EGLDisplay, EGLSurface, EGLSurface, EGLContext);
+EGLBoolean (*my_eglSwapBuffers)(EGLDisplay, EGLSurface);
+void (*my_glClear)(GLbitfield);
+void (*my_glClearColor)(GLclampf, GLclampf, GLclampf, GLclampf);
+void (*my_glViewport)(GLint, GLint, GLsizei, GLsizei);
+
+#define COMMON_USE_EGL
+#define COMMON_GL_PREFIX my_
+#define COMMON_EGL_PREFIX my_
+#include "common.c"
+
+static void
+resolve_symbols (void)
+{
+       void *glesv2_handle;
+       void *egl_handle;
+       char *error;
+
+       glesv2_handle = dlopen ("libGLESv2.so", RTLD_LAZY);
+       if (glesv2_handle == NULL) {
+               fprintf (stderr, "Error: Failed to open libGL.so\n");
+               exit (1);
+       }
+
+       egl_handle = dlopen ("libEGL.so", RTLD_LAZY);
+       if (egl_handle == NULL) {
+               fprintf (stderr, "Error: Failed to open libEGL.so\n");
+               exit (1);
+       }
+
+       /* Clear errors. */
+       dlerror();
+
+       my_eglBindAPI = dlsym (egl_handle, "eglBindAPI");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglBindAPI: %s\n", error);
+               exit (1);
+       }
+
+       my_eglChooseConfig = dlsym (egl_handle, "eglChooseConfig");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglChooseConfig: %s\n", error);
+               exit (1);
+       }
+
+       my_eglCreateContext = dlsym (egl_handle, "eglCreateContext");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglCreateContext: %s\n", error);
+               exit (1);
+       }
+
+       my_eglCreateWindowSurface = dlsym (egl_handle, "eglCreateWindowSurface");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglCreateWindowSurface: %s\n", error);
+               exit (1);
+       }
+
+       my_eglGetConfigAttrib = dlsym (egl_handle, "eglGetConfigAttrib");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglGetConfigAttrib: %s\n", error);
+               exit (1);
+       }
+
+       my_eglGetDisplay = dlsym (egl_handle, "eglGetDisplay");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglGetDisplay: %s\n", error);
+               exit (1);
+       }
+
+       my_eglInitialize = dlsym (egl_handle, "eglInitialize");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglInitialize: %s\n", error);
+               exit (1);
+       }
+
+       my_eglMakeCurrent = dlsym (egl_handle, "eglMakeCurrent");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglMakeCurrent: %s\n", error);
+               exit (1);
+       }
+
+       my_eglSwapBuffers = dlsym (egl_handle, "eglSwapBuffers");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglSwapBuffers: %s\n", error);
+               exit (1);
+       }
+
+       my_glClear = dlsym (glesv2_handle, "glClear");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym glClear: %s\n", error);
+               exit (1);
+       }
+
+       my_glClearColor = dlsym (glesv2_handle, "glClearColor");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym glClearColor: %s\n", error);
+               exit (1);
+       }
+
+       my_glViewport = dlsym (glesv2_handle, "glViewport");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym glViewport: %s\n", error);
+               exit (1);
+       }
+}
+
+int
+main (void)
+{
+        Display *dpy;
+       Window window;
+       EGLDisplay egl_dpy;
+       EGLContext ctx;
+       EGLConfig config;
+        EGLSurface surface;
+       XVisualInfo *visual_info;
+
+       resolve_symbols ();
+
+       dpy = util_x11_init_display ();
+
+       common_create_egl_context (dpy, EGL_OPENGL_ES_API, &egl_dpy,
+                                  &ctx, &config, &visual_info);
+
+       window = util_x11_init_window (dpy, visual_info);
+
+       surface = my_eglCreateWindowSurface (egl_dpy, config, window, NULL);
+
+       common_make_current (egl_dpy, ctx, surface);
+
+        common_handle_events (dpy, egl_dpy, surface);
+
+       util_x11_fini_window (dpy, window);
+
+       util_x11_fini_display (dpy);
+
+        return 0;
+}
diff --git a/test/egl-glesv2-dlopen-gpa.c b/test/egl-glesv2-dlopen-gpa.c
new file mode 100644 (file)
index 0000000..52e9f0e
--- /dev/null
@@ -0,0 +1,209 @@
+/* Copyright © 2013, Intel Corporation
+ *
+ * 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.
+ */
+
+/* Perform some simple drawing via OpenGL as follows:
+ *
+ *     1. Using EGL to construct an OpenGLESv2 context
+ *     2. By using dlopen to dynamically load libGLESv2.so
+ *     3. By using eglGetProcAddress to lookup OpenGL functions
+ */
+
+#define GL_GLEXT_PROTOTYPES
+#include <GLES2/gl2.h>
+#include <EGL/egl.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+
+#include "util-x11.h"
+
+EGLBoolean (*my_eglBindAPI)(EGLenum);
+EGLBoolean (*my_eglChooseConfig)(EGLDisplay, EGLint const *, EGLConfig *, EGLint, EGLint *);
+EGLContext (*my_eglCreateContext)(EGLDisplay, EGLConfig, EGLContext, EGLint const *);
+EGLSurface (*my_eglCreateWindowSurface)(EGLDisplay, EGLConfig, NativeWindowType, EGLint const *);
+EGLBoolean (*my_eglGetConfigAttrib)(EGLDisplay, EGLConfig, EGLint, EGLint *);
+EGLDisplay (*my_eglGetDisplay)(NativeDisplayType);
+void * (*my_eglGetProcAddress)(char const *);
+EGLBoolean (*my_eglInitialize)(EGLDisplay, EGLint *, EGLint *);
+EGLBoolean (*my_eglMakeCurrent)(EGLDisplay, EGLSurface, EGLSurface, EGLContext);
+EGLBoolean (*my_eglSwapBuffers)(EGLDisplay, EGLSurface);
+
+/* The OpenGL header files give typedefs for the types of all
+ * functions provided by etensisons. Here, though, we're using
+ * glxGetProcAddress to lookup core functions, so we provide our own
+ * typedefs. */
+typedef void (*FIPS_GLCLEAR_FN)(GLbitfield);
+FIPS_GLCLEAR_FN my_glClear;
+
+typedef void (*FIPS_GLCLEARCOLOR_FN)(GLclampf, GLclampf, GLclampf, GLclampf);
+FIPS_GLCLEARCOLOR_FN my_glClearColor;
+
+typedef void (*FIPS_GLVIEWPORT_FN)(GLint, GLint, GLsizei, GLsizei);
+FIPS_GLVIEWPORT_FN my_glViewport;
+
+#define COMMON_USE_EGL
+#define COMMON_GL_PREFIX my_
+#define COMMON_EGL_PREFIX my_
+#include "common.c"
+
+static void
+resolve_symbols (void)
+{
+       void *egl_handle, *glesv2_handle;
+       char *error;
+
+       egl_handle = dlopen ("libEGL.so", RTLD_LAZY);
+       if (egl_handle == NULL) {
+               fprintf (stderr, "Error: Failed to open libEGL.so\n");
+               exit (1);
+       }
+
+       glesv2_handle = dlopen ("libGLESv2.so", RTLD_LAZY);
+       if (glesv2_handle == NULL) {
+               fprintf (stderr, "Error: Failed to open libGLESv2.so\n");
+               exit (1);
+       }
+
+       /* Clear errors. */
+       dlerror();
+
+       my_eglBindAPI = dlsym (egl_handle, "eglBindAPI");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglBindAPI: %s\n", error);
+               exit (1);
+       }
+
+       my_eglChooseConfig = dlsym (egl_handle, "eglChooseConfig");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglChooseConfig: %s\n", error);
+               exit (1);
+       }
+
+       my_eglCreateContext = dlsym (egl_handle, "eglCreateContext");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglCreateContext: %s\n", error);
+               exit (1);
+       }
+
+       my_eglCreateWindowSurface = dlsym (egl_handle, "eglCreateWindowSurface");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglCreateWindowSurface: %s\n", error);
+               exit (1);
+       }
+
+       my_eglGetConfigAttrib = dlsym (egl_handle, "eglGetConfigAttrib");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglGetConfigAttrib: %s\n", error);
+               exit (1);
+       }
+
+       my_eglGetDisplay = dlsym (egl_handle, "eglGetDisplay");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglGetDisplay: %s\n", error);
+               exit (1);
+       }
+
+       my_eglGetProcAddress = dlsym (egl_handle, "eglGetProcAddress");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglGetProcAddress: %s\n", error);
+               exit (1);
+       }
+
+       my_eglInitialize = dlsym (egl_handle, "eglInitialize");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglInitialize: %s\n", error);
+               exit (1);
+       }
+
+       my_eglMakeCurrent = dlsym (egl_handle, "eglMakeCurrent");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglMakeCurrent: %s\n", error);
+               exit (1);
+       }
+
+       my_eglSwapBuffers = dlsym (egl_handle, "eglSwapBuffers");
+       error = dlerror ();
+       if (error) {
+               fprintf (stderr, "Failed to dlsym eglSwapBuffers: %s\n", error);
+               exit (1);
+       }
+
+       my_glClear = (FIPS_GLCLEAR_FN) my_eglGetProcAddress ("glClear");
+       if (my_glClear == NULL) {
+               fprintf (stderr, "Failed to eglGetProcAddress glClear\n");
+               exit (1);
+       }
+
+       my_glClearColor = (FIPS_GLCLEARCOLOR_FN) my_eglGetProcAddress ("glClearColor");
+       if (my_glClearColor == NULL) {
+               fprintf (stderr, "Failed to eglGetProcAddress glClearColor\n");
+               exit (1);
+       }
+
+       my_glViewport = (FIPS_GLVIEWPORT_FN) my_eglGetProcAddress ("glViewport");
+       if (my_glViewport == NULL) {
+               fprintf (stderr, "Failed to eglGetProcAddress glViewport\n");
+               exit (1);
+       }
+}
+
+int
+main (void)
+{
+        Display *dpy;
+       Window window;
+       EGLDisplay egl_dpy;
+       EGLContext ctx;
+       EGLConfig config;
+        EGLSurface surface;
+       XVisualInfo *visual_info;
+
+       resolve_symbols ();
+
+       dpy = util_x11_init_display ();
+
+       common_create_egl_context (dpy, EGL_OPENGL_ES_API, &egl_dpy,
+                                  &ctx, &config, &visual_info);
+
+       window = util_x11_init_window (dpy, visual_info);
+
+       surface = my_eglCreateWindowSurface (egl_dpy, config, window, NULL);
+
+       common_make_current (egl_dpy, ctx, surface);
+
+        common_handle_events (dpy, egl_dpy, surface);
+
+       util_x11_fini_window (dpy, window);
+
+       util_x11_fini_display (dpy);
+
+        return 0;
+}
diff --git a/test/egl-glesv2-link-call.c b/test/egl-glesv2-link-call.c
new file mode 100644 (file)
index 0000000..7faa3e2
--- /dev/null
@@ -0,0 +1,68 @@
+/* Copyright © 2013, Intel Corporation
+ *
+ * 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.
+ */
+
+/* Perform some simple drawing via OpenGL as follows:
+ *
+ *     1. Using EGL to construct an OpenGLESv2 context
+ *     2. By directly linking with libEGL.so and libGLESv2.so
+ *     3. By directly calling OpenGL functions
+ */
+
+#include <EGL/egl.h>
+#include <GLES2/gl2.h>
+
+#include "util-x11.h"
+
+#define COMMON_USE_EGL
+#define COMMON_GL_PREFIX
+#define COMMON_EGL_PREFIX
+#include "common.c"
+
+int
+main (void)
+{
+        Display *dpy;
+       Window window;
+       EGLDisplay egl_dpy;
+       EGLContext ctx;
+       EGLConfig config;
+        EGLSurface surface;
+       XVisualInfo *visual_info;
+
+       dpy = util_x11_init_display ();
+
+       common_create_egl_context (dpy, EGL_OPENGL_ES_API, &egl_dpy,
+                                  &ctx, &config, &visual_info);
+
+       window = util_x11_init_window (dpy, visual_info);
+
+       surface = eglCreateWindowSurface (egl_dpy, config, window, NULL);
+
+       common_make_current (egl_dpy, ctx, surface);
+
+        common_handle_events (dpy, egl_dpy, surface);
+
+       util_x11_fini_window (dpy, window);
+
+       util_x11_fini_display (dpy);
+
+        return 0;
+}
diff --git a/test/egl-glesv2-link-gpa.c b/test/egl-glesv2-link-gpa.c
new file mode 100644 (file)
index 0000000..a09ad8e
--- /dev/null
@@ -0,0 +1,109 @@
+/* Copyright © 2013, Intel Corporation
+ *
+ * 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.
+ */
+
+/* Perform some simple drawing via OpenGL as follows:
+ *
+ *     1. Using EGL to construct an OpenGLESv2 context
+ *     2. By directly linking with libEGL.so and libGLESv2.so
+ *     3. By using eglGetProcAddress to lookup OpenGL functions
+ */
+
+#define GL_GLEXT_PROTOTYPES
+#include <GLES2/gl2.h>
+#include <EGL/egl.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "util-x11.h"
+
+/* The OpenGL header files give typedefs for the types of all
+ * functions provided by etensisons. Here, though, we're using
+ * glxGetProcAddress to lookup core functions, so we provide our own
+ * typedefs. */
+typedef void (*FIPS_GLCLEAR_FN)(GLbitfield);
+FIPS_GLCLEAR_FN my_glClear;
+
+typedef void (*FIPS_GLCLEARCOLOR_FN)(GLclampf, GLclampf, GLclampf, GLclampf);
+FIPS_GLCLEARCOLOR_FN my_glClearColor;
+
+typedef void (*FIPS_GLVIEWPORT_FN)(GLint, GLint, GLsizei, GLsizei);
+FIPS_GLVIEWPORT_FN my_glViewport;
+
+#define COMMON_USE_EGL
+#define COMMON_GL_PREFIX my_
+#define COMMON_EGL_PREFIX
+#include "common.c"
+
+static void
+resolve_symbols (void)
+{
+       my_glClear = (FIPS_GLCLEAR_FN) eglGetProcAddress ("glClear");
+       if (my_glClear == NULL) {
+               fprintf (stderr, "Failed to eglGetProcAddress glClear\n");
+               exit (1);
+       }
+
+       my_glClearColor = (FIPS_GLCLEARCOLOR_FN) eglGetProcAddress ("glClearColor");
+       if (my_glClearColor == NULL) {
+               fprintf (stderr, "Failed to eglGetProcAddress glClearColor\n");
+               exit (1);
+       }
+
+       my_glViewport = (FIPS_GLVIEWPORT_FN) eglGetProcAddress ("glViewport");
+       if (my_glViewport == NULL) {
+               fprintf (stderr, "Failed to eglGetProcAddress glViewport\n");
+               exit (1);
+       }
+}
+
+int
+main (void)
+{
+        Display *dpy;
+       Window window;
+       EGLDisplay egl_dpy;
+       EGLContext ctx;
+       EGLConfig config;
+        EGLSurface surface;
+       XVisualInfo *visual_info;
+
+       resolve_symbols ();
+
+       dpy = util_x11_init_display ();
+
+       common_create_egl_context (dpy, EGL_OPENGL_ES_API, &egl_dpy,
+                                  &ctx, &config, &visual_info);
+
+       window = util_x11_init_window (dpy, visual_info);
+
+       surface = eglCreateWindowSurface (egl_dpy, config, window, NULL);
+
+       common_make_current (egl_dpy, ctx, surface);
+
+        common_handle_events (dpy, egl_dpy, surface);
+
+       util_x11_fini_window (dpy, window);
+
+       util_x11_fini_display (dpy);
+
+        return 0;
+}
index 803d10d15fdd5fa37f5f10ae5d79d79f6b1c3671..f27178eecae7b13c3688f852daa92b5cfb9c1679 100644 (file)
@@ -47,9 +47,6 @@ EGLBoolean (*my_eglMakeCurrent)(EGLDisplay, EGLSurface, EGLSurface, EGLContext);
 EGLBoolean (*my_eglSwapBuffers)(EGLDisplay, EGLSurface);
 void (*my_glClear)(GLbitfield);
 void (*my_glClearColor)(GLclampf, GLclampf, GLclampf, GLclampf);
-void (*my_glLoadIdentity)(void);
-void (*my_glMatrixMode)(GLenum);
-void (*my_glOrtho)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
 void (*my_glViewport)(GLint, GLint, GLsizei, GLsizei);
 
 #define COMMON_USE_EGL
@@ -156,27 +153,6 @@ resolve_symbols (void)
                exit (1);
        }
 
-       my_glLoadIdentity = dlsym (gl_handle, "glLoadIdentity");
-       error = dlerror ();
-       if (error) {
-               fprintf (stderr, "Failed to dlsym glLoadIdentity: %s\n", error);
-               exit (1);
-       }
-
-       my_glMatrixMode = dlsym (gl_handle, "glMatrixMode");
-       error = dlerror ();
-       if (error) {
-               fprintf (stderr, "Failed to dlsym glMatrixMode: %s\n", error);
-               exit (1);
-       }
-
-       my_glOrtho = dlsym (gl_handle, "glOrtho");
-       error = dlerror ();
-       if (error) {
-               fprintf (stderr, "Failed to dlsym glOrtho: %s\n", error);
-               exit (1);
-       }
-
        my_glViewport = dlsym (gl_handle, "glViewport");
        error = dlerror ();
        if (error) {
index 7923dcbd436e185d194ed62570f5b7f4d160c319..32cce04dc5128313ef5b2b71881994cf98c33c3a 100644 (file)
@@ -57,15 +57,6 @@ FIPS_GLCLEAR_FN my_glClear;
 typedef void (*FIPS_GLCLEARCOLOR_FN)(GLclampf, GLclampf, GLclampf, GLclampf);
 FIPS_GLCLEARCOLOR_FN my_glClearColor;
 
-typedef void (*FIPS_GLLOADIDENTITY_FN)(void);
-FIPS_GLLOADIDENTITY_FN my_glLoadIdentity;
-
-typedef void (*FIPS_GLMATRIXMODE_FN)(GLenum);
-FIPS_GLMATRIXMODE_FN my_glMatrixMode;
-
-typedef void (*FIPS_GLORTHO_FN)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
-FIPS_GLORTHO_FN my_glOrtho;
-
 typedef void (*FIPS_GLVIEWPORT_FN)(GLint, GLint, GLsizei, GLsizei);
 FIPS_GLVIEWPORT_FN my_glViewport;
 
@@ -177,24 +168,6 @@ resolve_symbols (void)
                exit (1);
        }
 
-       my_glLoadIdentity = (FIPS_GLLOADIDENTITY_FN) my_eglGetProcAddress ("glLoadIdentity");
-       if (my_glLoadIdentity == NULL) {
-               fprintf (stderr, "Failed to eglGetProcAddress glLoadIdentity\n");
-               exit (1);
-       }
-
-       my_glMatrixMode = (FIPS_GLMATRIXMODE_FN) my_eglGetProcAddress ("glMatrixMode");
-       if (my_glMatrixMode == NULL) {
-               fprintf (stderr, "Failed to eglGetProcAddress glMatrixMode\n");
-               exit (1);
-       }
-
-       my_glOrtho = (FIPS_GLORTHO_FN) my_eglGetProcAddress ("glOrtho");
-       if (my_glOrtho == NULL) {
-               fprintf (stderr, "Failed to eglGetProcAddress glOrtho\n");
-               exit (1);
-       }
-
        my_glViewport = (FIPS_GLVIEWPORT_FN) my_eglGetProcAddress ("glViewport");
        if (my_glViewport == NULL) {
                fprintf (stderr, "Failed to eglGetProcAddress glViewport\n");
index 7106e96bd5f3f6d0d972978aec1e7ff7730de9ac..3fb7853e4860d38d533128788c61ac089be0f7a4 100644 (file)
@@ -45,15 +45,6 @@ FIPS_GLCLEAR_FN my_glClear;
 typedef void (*FIPS_GLCLEARCOLOR_FN)(GLclampf, GLclampf, GLclampf, GLclampf);
 FIPS_GLCLEARCOLOR_FN my_glClearColor;
 
-typedef void (*FIPS_GLLOADIDENTITY_FN)(void);
-FIPS_GLLOADIDENTITY_FN my_glLoadIdentity;
-
-typedef void (*FIPS_GLMATRIXMODE_FN)(GLenum);
-FIPS_GLMATRIXMODE_FN my_glMatrixMode;
-
-typedef void (*FIPS_GLORTHO_FN)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
-FIPS_GLORTHO_FN my_glOrtho;
-
 typedef void (*FIPS_GLVIEWPORT_FN)(GLint, GLint, GLsizei, GLsizei);
 FIPS_GLVIEWPORT_FN my_glViewport;
 
@@ -77,24 +68,6 @@ resolve_symbols (void)
                exit (1);
        }
 
-       my_glLoadIdentity = (FIPS_GLLOADIDENTITY_FN) eglGetProcAddress ("glLoadIdentity");
-       if (my_glLoadIdentity == NULL) {
-               fprintf (stderr, "Failed to eglGetProcAddress glLoadIdentity\n");
-               exit (1);
-       }
-
-       my_glMatrixMode = (FIPS_GLMATRIXMODE_FN) eglGetProcAddress ("glMatrixMode");
-       if (my_glMatrixMode == NULL) {
-               fprintf (stderr, "Failed to eglGetProcAddress glMatrixMode\n");
-               exit (1);
-       }
-
-       my_glOrtho = (FIPS_GLORTHO_FN) eglGetProcAddress ("glOrtho");
-       if (my_glOrtho == NULL) {
-               fprintf (stderr, "Failed to eglGetProcAddress glOrtho\n");
-               exit (1);
-       }
-
        my_glViewport = (FIPS_GLVIEWPORT_FN) eglGetProcAddress ("glViewport");
        if (my_glViewport == NULL) {
                fprintf (stderr, "Failed to eglGetProcAddress glViewport\n");
index 331b87aa2acbe752a523594781ddfd3059eec697..ec1813811e8618692f50cd35641b5810497e65e7 100755 (executable)
@@ -44,10 +44,10 @@ test glx-dlopen-gpa
 printf "Testing        GLX             dlopen(libGL)   glXGetProcAddressARB    ... "
 test glx-dlopen-gpaa
 
-printf "Testing        EGL/OpenGL      link to libEGL  direct calls            ... "
+printf "Testing        EGL/OpenGL      link to libGL   direct calls            ... "
 test egl-opengl-link-call
 
-printf "Testing        EGL/OpenGL      link to libEGL  eglGetProcAddress       ... "
+printf "Testing        EGL/OpenGL      link to libGL   eglGetProcAddress       ... "
 test egl-opengl-link-gpa
 
 printf "Testing        EGL/OpenGL      dlopen(libGL)   dlsym                   ... "
@@ -56,6 +56,18 @@ test egl-opengl-dlopen-dlsym
 printf "Testing        EGL/OpenGL      dlopen(libGL)   eglGetProcAddress       ... "
 test egl-opengl-dlopen-gpa
 
+printf "Testing        EGL/GLESv2      link libGLESv2  direct calls            ... "
+test egl-glesv2-link-call
+
+printf "Testing        EGL/GLESv2      link libGLESv2  eglGetProcAddress       ... "
+test egl-glesv2-link-gpa
+
+printf "Testing        EGL/GLESv2      dlopen(GLESv2)  dlsym                   ... "
+test egl-glesv2-dlopen-dlsym
+
+printf "Testing        EGL/GLESv2      dlopen(GLESv2)  eglGetProcAddress       ... "
+test egl-glesv2-dlopen-gpa
+
 echo ""
 
 if [ $errors -gt 0 ]; then
index 6252c61d56403e88ea12f008b551d38cc43e094c..dd615237ffbdcb29c95ee5dd6de806ecb8bce6c9 100644 (file)
@@ -38,9 +38,6 @@
 
 void (*my_glClear) (GLbitfield);
 void (*my_glClearColor) (GLclampf, GLclampf, GLclampf, GLclampf);
-void (*my_glLoadIdentity) (void);
-void (*my_glMatrixMode) (GLenum);
-void (*my_glOrtho) (GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
 void (*my_glViewport) (GLint, GLint, GLsizei, GLsizei);
 XVisualInfo * (*my_glXChooseVisual) (Display *, int, int *);
 GLXContext (*my_glXCreateContext) (Display *, XVisualInfo *, GLXContext, Bool);
@@ -80,27 +77,6 @@ resolve_symbols (void)
                exit (1);
        }
 
-       my_glLoadIdentity = dlsym (gl_handle, "glLoadIdentity");
-       error = dlerror ();
-       if (error) {
-               fprintf (stderr, "Failed to dlsym glLoadIdentity: %s\n", error);
-               exit (1);
-       }
-
-       my_glMatrixMode = dlsym (gl_handle, "glMatrixMode");
-       error = dlerror ();
-       if (error) {
-               fprintf (stderr, "Failed to dlsym glMatrixMode: %s\n", error);
-               exit (1);
-       }
-
-       my_glOrtho = dlsym (gl_handle, "glOrtho");
-       error = dlerror ();
-       if (error) {
-               fprintf (stderr, "Failed to dlsym glOrtho: %s\n", error);
-               exit (1);
-       }
-
        my_glViewport = dlsym (gl_handle, "glViewport");
        error = dlerror ();
        if (error) {
index 514f6714909607abf7a794b509755c9869044103..902802368d02878f6a60cac24d755b24ed7959ed 100644 (file)
@@ -39,9 +39,6 @@
 void* (*my_glXGetProcAddress) (char *);
 void (*my_glClear) (GLbitfield);
 void (*my_glClearColor) (GLclampf, GLclampf, GLclampf, GLclampf);
-void (*my_glLoadIdentity) (void);
-void (*my_glMatrixMode) (GLenum);
-void (*my_glOrtho) (GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
 void (*my_glViewport) (GLint, GLint, GLsizei, GLsizei);
 XVisualInfo * (*my_glXChooseVisual) (Display *, int, int *);
 GLXContext (*my_glXCreateContext) (Display *, XVisualInfo *, GLXContext, Bool);
@@ -86,24 +83,6 @@ resolve_symbols (void)
                exit (1);
        }
 
-       my_glLoadIdentity = my_glXGetProcAddress ("glLoadIdentity");
-       if (my_glLoadIdentity == NULL) {
-               fprintf (stderr, "Failed to glXGetProcAddress glLoadIdentity\n");
-               exit (1);
-       }
-
-       my_glMatrixMode = my_glXGetProcAddress ("glMatrixMode");
-       if (my_glMatrixMode == NULL) {
-               fprintf (stderr, "Failed to glXGetProcAddress glMatrixMode\n");
-               exit (1);
-       }
-
-       my_glOrtho = my_glXGetProcAddress ("glOrtho");
-       if (my_glOrtho == NULL) {
-               fprintf (stderr, "Failed to glXGetProcAddress glOrtho\n");
-               exit (1);
-       }
-
        my_glViewport = my_glXGetProcAddress ("glViewport");
        if (my_glViewport == NULL) {
                fprintf (stderr, "Failed to glXGetProcAddress glViewport\n");
index 61129a187968fcb0d4a9a41f8e5202d77ad9adb0..cd4595b10c52a7bfca837bd1464d4f560d9ea15a 100644 (file)
@@ -39,9 +39,6 @@
 void* (*my_glXGetProcAddressARB) (char *);
 void (*my_glClear) (GLbitfield);
 void (*my_glClearColor) (GLclampf, GLclampf, GLclampf, GLclampf);
-void (*my_glLoadIdentity) (void);
-void (*my_glMatrixMode) (GLenum);
-void (*my_glOrtho) (GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
 void (*my_glViewport) (GLint, GLint, GLsizei, GLsizei);
 XVisualInfo * (*my_glXChooseVisual) (Display *, int, int *);
 GLXContext (*my_glXCreateContext) (Display *, XVisualInfo *, GLXContext, Bool);
@@ -86,24 +83,6 @@ resolve_symbols (void)
                exit (1);
        }
 
-       my_glLoadIdentity = my_glXGetProcAddressARB ("glLoadIdentity");
-       if (my_glLoadIdentity == NULL) {
-               fprintf (stderr, "Failed to glXGetProcAddressARB glLoadIdentity\n");
-               exit (1);
-       }
-
-       my_glMatrixMode = my_glXGetProcAddressARB ("glMatrixMode");
-       if (my_glMatrixMode == NULL) {
-               fprintf (stderr, "Failed to glXGetProcAddressARB glMatrixMode\n");
-               exit (1);
-       }
-
-       my_glOrtho = my_glXGetProcAddressARB ("glOrtho");
-       if (my_glOrtho == NULL) {
-               fprintf (stderr, "Failed to glXGetProcAddressARB glOrtho\n");
-               exit (1);
-       }
-
        my_glViewport = my_glXGetProcAddressARB ("glViewport");
        if (my_glViewport == NULL) {
                fprintf (stderr, "Failed to glXGetProcAddressARB glViewport\n");
index 83e00a394ca94af2ca2372a756911bbf6968c140..3b19b1ee95ab9d6da295525e1d1eb2259dcf9863 100644 (file)
@@ -45,15 +45,6 @@ FIPS_GLCLEAR_FN my_glClear;
 typedef void (*FIPS_GLCLEARCOLOR_FN)(GLclampf, GLclampf, GLclampf, GLclampf);
 FIPS_GLCLEARCOLOR_FN my_glClearColor;
 
-typedef void (*FIPS_GLLOADIDENTITY_FN)(void);
-FIPS_GLLOADIDENTITY_FN my_glLoadIdentity;
-
-typedef void (*FIPS_GLMATRIXMODE_FN)(GLenum);
-FIPS_GLMATRIXMODE_FN my_glMatrixMode;
-
-typedef void (*FIPS_GLORTHO_FN)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
-FIPS_GLORTHO_FN my_glOrtho;
-
 typedef void (*FIPS_GLVIEWPORT_FN)(GLint, GLint, GLsizei, GLsizei);
 FIPS_GLVIEWPORT_FN my_glViewport;
 
@@ -90,24 +81,6 @@ resolve_symbols (void)
                exit (1);
        }
 
-       my_glLoadIdentity = (FIPS_GLLOADIDENTITY_FN) glXGetProcAddress ((GLubyte*) "glLoadIdentity");
-       if (my_glLoadIdentity == NULL) {
-               fprintf (stderr, "Failed to glXGetProcAddress glLoadIdentity\n");
-               exit (1);
-       }
-
-       my_glMatrixMode = (FIPS_GLMATRIXMODE_FN) glXGetProcAddress ((GLubyte*) "glMatrixMode");
-       if (my_glMatrixMode == NULL) {
-               fprintf (stderr, "Failed to glXGetProcAddress glMatrixMode\n");
-               exit (1);
-       }
-
-       my_glOrtho = (FIPS_GLORTHO_FN) glXGetProcAddress ((GLubyte*) "glOrtho");
-       if (my_glOrtho == NULL) {
-               fprintf (stderr, "Failed to glXGetProcAddress glOrtho\n");
-               exit (1);
-       }
-
        my_glViewport = (FIPS_GLVIEWPORT_FN) glXGetProcAddress ((GLubyte*) "glViewport");
        if (my_glViewport == NULL) {
                fprintf (stderr, "Failed to glXGetProcAddress glViewport\n");
index 91e5e872579482b31a2dc1fada47271ee09cc0af..266c564cbecbaabccc2185eee2930e2035d35b5b 100644 (file)
@@ -45,15 +45,6 @@ FIPS_GLCLEAR_FN my_glClear;
 typedef void (*FIPS_GLCLEARCOLOR_FN)(GLclampf, GLclampf, GLclampf, GLclampf);
 FIPS_GLCLEARCOLOR_FN my_glClearColor;
 
-typedef void (*FIPS_GLLOADIDENTITY_FN)(void);
-FIPS_GLLOADIDENTITY_FN my_glLoadIdentity;
-
-typedef void (*FIPS_GLMATRIXMODE_FN)(GLenum);
-FIPS_GLMATRIXMODE_FN my_glMatrixMode;
-
-typedef void (*FIPS_GLORTHO_FN)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble);
-FIPS_GLORTHO_FN my_glOrtho;
-
 typedef void (*FIPS_GLVIEWPORT_FN)(GLint, GLint, GLsizei, GLsizei);
 FIPS_GLVIEWPORT_FN my_glViewport;
 
@@ -90,24 +81,6 @@ resolve_symbols (void)
                exit (1);
        }
 
-       my_glLoadIdentity = (FIPS_GLLOADIDENTITY_FN) glXGetProcAddressARB ((GLubyte*) "glLoadIdentity");
-       if (my_glLoadIdentity == NULL) {
-               fprintf (stderr, "Failed to glXGetProcAddressARB glLoadIdentity\n");
-               exit (1);
-       }
-
-       my_glMatrixMode = (FIPS_GLMATRIXMODE_FN) glXGetProcAddressARB ((GLubyte*) "glMatrixMode");
-       if (my_glMatrixMode == NULL) {
-               fprintf (stderr, "Failed to glXGetProcAddressARB glMatrixMode\n");
-               exit (1);
-       }
-
-       my_glOrtho = (FIPS_GLORTHO_FN) glXGetProcAddressARB ((GLubyte*) "glOrtho");
-       if (my_glOrtho == NULL) {
-               fprintf (stderr, "Failed to glXGetProcAddressARB glOrtho\n");
-               exit (1);
-       }
-
        my_glViewport = (FIPS_GLVIEWPORT_FN) glXGetProcAddressARB ((GLubyte*) "glViewport");
        if (my_glViewport == NULL) {
                fprintf (stderr, "Failed to glXGetProcAddressARB glViewport\n");