glx_proto.h revision d0442182bcb269db0e724161682f61b63188c127
/* $Id$ */
/** @file
*
* VirtualBox guest OpenGL DRI GLX header C prototypes
*/
/*
* Copyright (C) 2006-2008 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#ifndef ___CROPENGL_DRI_GLX_H
#define ___CROPENGL_DRI_GLX_H
#include "chromium.h"
#include "stub.h"
#ifndef VBOX_OGL_GLX_USE_CSTUBS
#endif
#ifdef VBOXOGL_FAKEDRI
typedef const char * (*PGLXFUNC_GetDriverConfig)(const char *driverName);
typedef Bool (*PGLXFUNC_MakeCurrentReadSGI)(Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
typedef Display * (*PGLXFUNC_GetCurrentDisplayEXT)(void);
/*Mesa insternal*/
typedef GLXPixmap (*PGLXFUNC_CreateGLXPixmapMESA)(Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
#endif
/*Common glX functions*/
#if defined(SunOS)
unsigned long mask);
#else
unsigned long mask);
#endif
typedef GLXDrawable (*PGLXFUNC_GetCurrentDrawable)(void);
typedef void (*PGLXFUNC_WaitGL)(void);
typedef Display * (*PGLXFUNC_GetCurrentDisplay)(void);
typedef GLXContext (*PGLXFUNC_CreateContext)(Display *dpy, XVisualInfo *vis, GLXContext share, Bool direct);
typedef void (*PGLXFUNC_WaitX)(void);
typedef GLXContext (*PGLXFUNC_GetCurrentContext)(void);
/**
* Set this to 1 if you want to build stub functions for the
* GL_SGIX_pbuffer and GLX_SGIX_fbconfig extensions.
* This used to be disabled, due to "messy compilation issues",
* according to the earlier comment; but they're needed just
* to resolve symbols for OpenInventor applications, and I
* haven't found any reference to exactly what the "messy compilation
* issues" are, so I'm re-enabling the code by default.
*/
#define GLX_EXTRAS 1
#define GLX_SGIX_video_resize 1
/**
* Unfortunately, there's some inconsistency between the extension
* specs, and the SGI, NVIDIA, XFree86 and common glxext.h header
* files.
*/
#if defined(GLX_GLXEXT_VERSION)
/* match glxext.h, XFree86, Mesa */
#define ATTRIB_TYPE const int
#else
#define ATTRIB_TYPE int
#endif
#if GLX_EXTRAS
typedef GLXPbufferSGIX (*PGLXFUNC_CreateGLXPbufferSGIX)
typedef int (*PGLXFUNC_QueryGLXPbufferSGIX)
typedef GLXFBConfigSGIX * (*PGLXFUNC_ChooseFBConfigSGIX)
typedef void (*PGLXFUNC_GetSelectedEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long *mask);
typedef GLXContext (*PGLXFUNC_CreateContextWithConfigSGIX)
typedef GLXPixmap (*PGLXFUNC_CreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfig config, Pixmap pixmap);
typedef int (*PGLXFUNC_GetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config, int attribute, int *value);
/*
* GLX 1.3 functions
*/
typedef GLXFBConfig * (*PGLXFUNC_ChooseFBConfig)(Display *dpy, int screen, ATTRIB_TYPE *attrib_list, int *nelements);
typedef GLXPbuffer (*PGLXFUNC_CreatePbuffer)(Display *dpy, GLXFBConfig config, ATTRIB_TYPE *attrib_list);
typedef GLXPixmap (*PGLXFUNC_CreatePixmap)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const ATTRIB_TYPE *attrib_list);
typedef GLXWindow (*PGLXFUNC_CreateWindow)(Display *dpy, GLXFBConfig config, Window win, ATTRIB_TYPE *attrib_list);
typedef GLXContext (*PGLXFUNC_CreateNewContext)
typedef GLXDrawable (*PGLXFUNC_GetCurrentReadDrawable)(void);
typedef int (*PGLXFUNC_GetFBConfigAttrib)(Display *dpy, GLXFBConfig config, int attribute, int *value);
typedef void (*PGLXFUNC_GetSelectedEvent)(Display *dpy, GLXDrawable draw, unsigned long *event_mask);
typedef Bool (*PGLXFUNC_MakeContextCurrent)(Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
typedef void (*PGLXFUNC_QueryDrawable)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
#ifdef CR_EXT_texture_from_pixmap
typedef void (*PGLXFUNC_BindTexImageEXT)(Display *dpy, GLXDrawable draw, int buffer, const int *attrib_list);
#endif
#endif /* GLX_EXTRAS */
#endif //___CROPENGL_DRI_GLX_H