~glproxy-dev/glproxy/trunk

« back to all changes in this revision

Viewing changes to tests/triangle/triangle.c

  • Committer: Marc Ordinas i Llopis
  • Date: 2011-12-08 11:35:53 UTC
  • mfrom: (35.1.7 fixes)
  • Revision ID: marc.ordinasillopis@linaro.org-20111208113553-og785wmh311tv427
EGL support: Add EGL virtualization support to glproxy.

Also,
- Removed the "automagic" best renderer detection, as it needed to start
both EGL and GLX which caused problems on some systems. It will return,
but in a more application-controlled way.
- Now it's necessary to pass the current display to the extensions helper
functions, as using an internal one caused NULL being returned as the
extensions string in some systems.
- A lot of code clean-ups.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <X11/Xlib.h>
25
25
#include <X11/Xutil.h>
26
26
#include <X11/keysym.h>
27
 
#include <EGL/egl.h>
 
27
#include <EGL/egl_proxy.h>
28
28
#include <GL/gl_proxy.h>
29
29
#include <GL/glx_proxy.h>
30
30
 
490
490
main(int argc, char *argv[])
491
491
{
492
492
   const int winWidth = 300, winHeight = 300;
493
 
   Display *x_dpy;
494
 
   Window win;
495
 
   EGLSurface egl_surf;
496
 
   EGLContext egl_ctx;
497
 
   EGLDisplay egl_dpy;
 
493
   Display *x_dpy = NULL;
 
494
   Window win = 0;
 
495
   EGLSurface egl_surf = NULL;
 
496
   EGLContext egl_ctx = NULL;
 
497
   EGLDisplay egl_dpy = NULL;
498
498
   char *dpyName = NULL;
499
499
   GLboolean printInfo = GL_FALSE;
500
500
   EGLint egl_major, egl_minor;
501
501
   int i;
502
502
   const char *s;
503
 
   GLXContext glx_ctx;
 
503
   GLXContext glx_ctx = NULL;
504
504
 
505
505
   for (i = 1; i < argc; i++) {
506
506
      if (strcmp(argv[i], "-display") == 0) {