{
VAOpenGLVTableP pOpenGLVTable = gl_get_vtable(ctx);
+ pOpenGLVTable->glx_create_pixmap = (PFNGLXCREATEPIXMAPPROC)
+ get_proc_address("glXCreatePixmap");
+ if (!pOpenGLVTable->glx_create_pixmap)
+ return 0;
+ pOpenGLVTable->glx_destroy_pixmap = (PFNGLXDESTROYPIXMAPPROC)
+ get_proc_address("glXDestroyPixmap");
+ if (!pOpenGLVTable->glx_destroy_pixmap)
+ return 0;
pOpenGLVTable->glx_bind_tex_image = (PFNGLXBINDTEXIMAGEEXTPROC)
get_proc_address("glXBindTexImageEXT");
if (!pOpenGLVTable->glx_bind_tex_image)
// Create Pixmaps for GLX texture-from-pixmap extension
static int create_tfp_surface(VADriverContextP ctx, VASurfaceGLXP pSurfaceGLX)
{
- const unsigned int width = pSurfaceGLX->width;
- const unsigned int height = pSurfaceGLX->height;
- Pixmap pixmap = None;
- GLXFBConfig *fbconfig = NULL;
- GLXPixmap glx_pixmap = None;
- Window root_window;
- XWindowAttributes wattr;
- int *attrib;
- int n_fbconfig_attrs;
+ VAOpenGLVTableP const pOpenGLVTable = gl_get_vtable(ctx);
+ const unsigned int width = pSurfaceGLX->width;
+ const unsigned int height = pSurfaceGLX->height;
+ Pixmap pixmap = None;
+ GLXFBConfig *fbconfig = NULL;
+ GLXPixmap glx_pixmap = None;
+ Window root_window;
+ XWindowAttributes wattr;
+ int *attrib;
+ int n_fbconfig_attrs;
root_window = RootWindow((Display *)ctx->native_dpy, ctx->x11_screen);
XGetWindowAttributes((Display *)ctx->native_dpy, root_window, &wattr);
*attrib++ = GL_NONE;
x11_trap_errors();
- glx_pixmap = glXCreatePixmap(
+ glx_pixmap = pOpenGLVTable->glx_create_pixmap(
(Display *)ctx->native_dpy,
fbconfig[0],
pixmap,
// Destroy Pixmaps used for TFP
static void destroy_tfp_surface(VADriverContextP ctx, VASurfaceGLXP pSurfaceGLX)
{
+ VAOpenGLVTableP const pOpenGLVTable = gl_get_vtable(ctx);
+
if (pSurfaceGLX->pix_texture) {
glDeleteTextures(1, &pSurfaceGLX->pix_texture);
pSurfaceGLX->pix_texture = 0;
}
if (pSurfaceGLX->glx_pixmap) {
- glXDestroyPixmap((Display *)ctx->native_dpy, pSurfaceGLX->glx_pixmap);
+ pOpenGLVTable->glx_destroy_pixmap((Display *)ctx->native_dpy, pSurfaceGLX->glx_pixmap);
pSurfaceGLX->glx_pixmap = None;
}
#include "va_x11.h"
#include "va_glx.h"
#include "va_backend_glx.h"
+#include <GL/glxext.h>
#if GLX_GLXEXT_VERSION < 18
typedef void (*PFNGLXBINDTEXIMAGEEXTPROC)(Display *, GLXDrawable, int, const int *);
typedef void (*PFNGLXRELEASETEXIMAGEEXTPROC)(Display *, GLXDrawable, int);
#endif
+#if GLX_GLXEXT_VERSION < 27
+/* XXX: this is not exactly that version but this is the only means to
+ make sure we have the correct <GL/glx.h> with those signatures */
+typedef GLXPixmap (*PFNGLXCREATEPIXMAPPROC)(Display *, GLXFBConfig, Pixmap, const int *);
+typedef void (*PFNGLXDESTROYPIXMAPPROC)(Display *, GLXPixmap);
+#endif
+
typedef struct VAOpenGLVTable *VAOpenGLVTableP;
struct VAOpenGLVTable {
+ PFNGLXCREATEPIXMAPPROC glx_create_pixmap;
+ PFNGLXDESTROYPIXMAPPROC glx_destroy_pixmap;
PFNGLXBINDTEXIMAGEEXTPROC glx_bind_tex_image;
PFNGLXRELEASETEXIMAGEEXTPROC glx_release_tex_image;
PFNGLGENFRAMEBUFFERSEXTPROC gl_gen_framebuffers;