~glproxy-dev/glproxy/trunk

« back to all changes in this revision

Viewing changes to tests/tfp/glx_tfp.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:
97
97
   printf("GLX extensions: %s\n", ext);
98
98
 
99
99
   glXBindTexImageEXT_ = (PFNPROXYBINDTEXIMAGEEXTPROC)
100
 
           glProxyGetExtProcAddr("GLX_EXT_texture_from_pixmap", "glXBindTexImageEXT");
 
100
           glProxyGetExtProcAddr(dpy,
 
101
                   "GLX_EXT_texture_from_pixmap", "glXBindTexImageEXT");
101
102
   glXReleaseTexImageEXT_ = (PFNPROXYRELEASETEXIMAGEEXTPROC)
102
 
        glProxyGetExtProcAddr("GLX_EXT_texture_from_pixmap", "glXReleaseTexImageEXT");
 
103
        glProxyGetExtProcAddr(dpy,
 
104
                   "GLX_EXT_texture_from_pixmap", "glXReleaseTexImageEXT");
103
105
 
104
106
   if (!glXBindTexImageEXT_ || !glXReleaseTexImageEXT_) {
105
 
      fprintf(stderr, "glProxyGetProcAddress failed!\n");
 
107
      fprintf(stderr, "GLX_EXT_texture_from_pixmap is not supported, exiting.\n");
106
108
      exit(1);
107
109
   }
108
110
      
332
334
static void
333
335
Resize(Window win, unsigned int width, unsigned int height)
334
336
{
 
337
    (void)win; // Unused
335
338
   glViewport(0, 0, width, height);
336
339
}
337
340
 
339
342
static void
340
343
Redraw(Display *dpy, Window win, float rot)
341
344
{
 
345
    (void)rot; // Unused
342
346
   const GLfloat verts[4][3] = {
343
347
      { -1, -1, 0 },
344
348
      {  1, -1, 0 },
437
441
   Pixmap p;
438
442
   PROXY_BACKEND_OPTION backend = OPENGL_BACKEND;
439
443
 
 
444
   (void) argc; // Unused
 
445
   (void) argv; // Unused
 
446
 
440
447
   if ((glProxyInit(&backend) < 0) || (backend != OPENGL_BACKEND)) {
441
448
      printf("OpenGL Backend not available\n");
442
449
      exit(1);