VirtualBox

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

Last change on this file since 70344 was 69500, checked in by vboxsync, 7 years ago

*: scm --update-copyright-year

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