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