VirtualBox

source: vbox/trunk/src/VBox/Additions/common/crOpenGL/glx_proto.h@ 18545

Last change on this file since 18545 was 18545, checked in by vboxsync, 16 years ago

crOpenGL: part fix compile for solaris

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.9 KB
Line 
1/* $Id: glx_proto.h 18545 2009-03-30 13:32:11Z vboxsync $ */
2/** @file
3 *
4 * VirtualBox guest OpenGL DRI GLX header C prototypes
5 */
6
7/*
8 * Copyright (C) 2006-2008 Sun Microsystems, Inc.
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
19 * Clara, CA 95054 USA or visit http://www.sun.com if you need
20 * additional information or have any questions.
21 */
22
23#ifndef ___CROPENGL_GLX_PROTO_H
24#define ___CROPENGL_GLX_PROTO_H
25
26#include "chromium.h"
27#include "stub.h"
28
29#ifndef VBOX_OGL_GLX_USE_CSTUBS
30# error VBOX_OGL_GLX_USE_CSTUBS not defined.
31#endif
32
33#ifdef VBOXOGL_FAKEDRI
34typedef const char * (*PGLXFUNC_GetDriverConfig)(const char *driverName);
35typedef void (*PGLXFUNC_FreeMemoryMESA)(Display *dpy, int scrn, void *pointer);
36typedef GLXContext (*PGLXFUNC_ImportContextEXT)(Display *dpy, GLXContextID contextID);
37typedef GLXContextID (*PGLXFUNC_GetContextIDEXT)(const GLXContext ctx);
38typedef Bool (*PGLXFUNC_MakeCurrentReadSGI)(Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
39typedef const char * (*PGLXFUNC_GetScreenDriver)(Display *dpy, int scrNum);
40typedef Display * (*PGLXFUNC_GetCurrentDisplayEXT)(void);
41typedef void (*PGLXFUNC_FreeContextEXT)(Display *dpy, GLXContext ctx);
42
43/*Mesa insternal*/
44typedef int (*PGLXFUNC_QueryContextInfoEXT)(Display *dpy, GLXContext ctx);
45typedef void * (*PGLXFUNC_AllocateMemoryMESA)(Display *dpy, int scrn,
46 size_t size, float readFreq,
47 float writeFreq, float priority);
48typedef GLuint (*PGLXFUNC_GetMemoryOffsetMESA)(Display *dpy, int scrn, const void *pointer );
49typedef GLXPixmap (*PGLXFUNC_CreateGLXPixmapMESA)(Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
50#endif
51
52/*Common glX functions*/
53typedef void (*PGLXFUNC_CopyContext)(Display *dpy, GLXContext src, GLXContext dst,unsigned long mask);
54typedef void (*PGLXFUNC_UseXFont)(Font font, int first, int count, int listBase);
55typedef CR_GLXFuncPtr (*PGLXFUNC_GetProcAddress)(const GLubyte *name);
56typedef Bool (*PGLXFUNC_QueryExtension)(Display *dpy, int *errorBase, int *eventBase);
57typedef Bool (*PGLXFUNC_glXIsDirect)(Display *dpy, GLXContext ctx);
58typedef GLXPixmap (*PGLXFUNC_CreateGLXPixmap)(Display *dpy, XVisualInfo *vis, Pixmap pixmap);
59typedef void (*PGLXFUNC_SwapBuffers)(Display *dpy, GLXDrawable drawable);
60typedef GLXDrawable (*PGLXFUNC_GetCurrentDrawable)(void);
61typedef void (*PGLXFUNC_WaitGL)(void);
62typedef Display * (*PGLXFUNC_GetCurrentDisplay)(void);
63typedef const char * (*PGLXFUNC_QueryServerString)(Display *dpy, int screen, int name);
64typedef GLXContext (*PGLXFUNC_CreateContext)(Display *dpy, XVisualInfo *vis, GLXContext share, Bool direct);
65typedef int (*PGLXFUNC_GetConfig)(Display *dpy, XVisualInfo *vis, int attrib, int *value);
66typedef void (*PGLXFUNC_WaitX)(void);
67typedef GLXContext (*PGLXFUNC_GetCurrentContext)(void);
68typedef const char * (*PGLXFUNC_GetClientString)(Display *dpy, int name);
69typedef Bool (*PGLXFUNC_MakeCurrent)(Display *dpy, GLXDrawable drawable, GLXContext ctx);
70typedef void (*PGLXFUNC_DestroyContext)(Display *dpy, GLXContext ctx);
71typedef CR_GLXFuncPtr (*PGLXFUNC_GetProcAddressARB)(const GLubyte *name);
72typedef void (*PGLXFUNC_DestroyGLXPixmap)(Display *dpy, GLXPixmap pix);
73typedef Bool (*PGLXFUNC_QueryVersion)(Display *dpy, int *major, int *minor);
74typedef XVisualInfo * (*PGLXFUNC_ChooseVisual)(Display *dpy, int screen, int *attribList);
75typedef const char * (*PGLXFUNC_QueryExtensionsString)(Display *dpy, int screen);
76
77/**
78 * Set this to 1 if you want to build stub functions for the
79 * GL_SGIX_pbuffer and GLX_SGIX_fbconfig extensions.
80 * This used to be disabled, due to "messy compilation issues",
81 * according to the earlier comment; but they're needed just
82 * to resolve symbols for OpenInventor applications, and I
83 * haven't found any reference to exactly what the "messy compilation
84 * issues" are, so I'm re-enabling the code by default.
85 */
86#define GLX_EXTRAS 1
87
88#define GLX_SGIX_video_resize 1
89
90/**
91 * Prototypes, in case they're not in glx.h or glxext.h
92 * Unfortunately, there's some inconsistency between the extension
93 * specs, and the SGI, NVIDIA, XFree86 and common glxext.h header
94 * files.
95 */
96#if defined(GLX_GLXEXT_VERSION)
97/* match glxext.h, XFree86, Mesa */
98#define ATTRIB_TYPE const int
99#else
100#define ATTRIB_TYPE int
101#endif
102
103#if GLX_EXTRAS
104typedef GLXPbufferSGIX (*PGLXFUNC_CreateGLXPbufferSGIX)
105(Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
106
107typedef int (*PGLXFUNC_QueryGLXPbufferSGIX)
108(Display *dpy, GLXPbuffer pbuf, int attribute, unsigned int *value);
109
110typedef GLXFBConfigSGIX * (*PGLXFUNC_ChooseFBConfigSGIX)
111(Display *dpy, int screen, int *attrib_list, int *nelements);
112
113typedef void (*PGLXFUNC_DestroyGLXPbufferSGIX)(Display *dpy, GLXPbuffer pbuf);
114typedef void (*PGLXFUNC_SelectEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long mask);
115typedef void (*PGLXFUNC_GetSelectedEventSGIX)(Display *dpy, GLXDrawable drawable, unsigned long *mask);
116
117typedef GLXFBConfigSGIX (*PGLXFUNC_GetFBConfigFromVisualSGIX)(Display *dpy, XVisualInfo *vis);
118typedef XVisualInfo * (*PGLXFUNC_GetVisualFromFBConfigSGIX)(Display *dpy, GLXFBConfig config);
119typedef GLXContext (*PGLXFUNC_CreateContextWithConfigSGIX)
120(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
121
122typedef GLXPixmap (*PGLXFUNC_CreateGLXPixmapWithConfigSGIX)(Display *dpy, GLXFBConfig config, Pixmap pixmap);
123typedef int (*PGLXFUNC_GetFBConfigAttribSGIX)(Display *dpy, GLXFBConfig config, int attribute, int *value);
124
125/*
126 * GLX 1.3 functions
127 */
128typedef GLXFBConfig * (*PGLXFUNC_ChooseFBConfig)(Display *dpy, int screen, ATTRIB_TYPE *attrib_list, int *nelements);
129typedef GLXPbuffer (*PGLXFUNC_CreatePbuffer)(Display *dpy, GLXFBConfig config, ATTRIB_TYPE *attrib_list);
130typedef GLXPixmap (*PGLXFUNC_CreatePixmap)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const ATTRIB_TYPE *attrib_list);
131typedef GLXWindow (*PGLXFUNC_CreateWindow)(Display *dpy, GLXFBConfig config, Window win, ATTRIB_TYPE *attrib_list);
132typedef GLXContext (*PGLXFUNC_CreateNewContext)
133(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
134
135typedef void (*PGLXFUNC_DestroyPbuffer)(Display *dpy, GLXPbuffer pbuf);
136typedef void (*PGLXFUNC_DestroyPixmap)(Display *dpy, GLXPixmap pixmap);
137typedef void (*PGLXFUNC_DestroyWindow)(Display *dpy, GLXWindow win);
138typedef GLXDrawable (*PGLXFUNC_GetCurrentReadDrawable)(void);
139typedef int (*PGLXFUNC_GetFBConfigAttrib)(Display *dpy, GLXFBConfig config, int attribute, int *value);
140typedef GLXFBConfig * (*PGLXFUNC_GetFBConfigs)(Display *dpy, int screen, int *nelements);
141typedef void (*PGLXFUNC_GetSelectedEvent)(Display *dpy, GLXDrawable draw, unsigned long *event_mask);
142typedef XVisualInfo * (*PGLXFUNC_GetVisualFromFBConfig)(Display *dpy, GLXFBConfig config);
143typedef Bool (*PGLXFUNC_MakeContextCurrent)(Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
144typedef int (*PGLXFUNC_QueryContext)(Display *dpy, GLXContext ctx, int attribute, int *value);
145typedef void (*PGLXFUNC_QueryDrawable)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
146typedef void (*PGLXFUNC_SelectEvent)(Display *dpy, GLXDrawable draw, unsigned long event_mask);
147
148#ifdef CR_EXT_texture_from_pixmap
149typedef void (*PGLXFUNC_BindTexImageEXT)(Display *dpy, GLXDrawable draw, int buffer, const int *attrib_list);
150typedef void (*PGLXFUNC_ReleaseTexImageEXT)(Display *dpy, GLXDrawable draw, int buffer);
151#endif
152
153#endif /* GLX_EXTRAS */
154
155#endif //___CROPENGL_GLX_PROTO_H
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette