VirtualBox

source: vbox/trunk/include/VBox/HostServices/VBoxOpenGLSvc.h@ 78377

Last change on this file since 78377 was 76585, checked in by vboxsync, 6 years ago

*: scm --fix-header-guard-endif

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 4.5 KB
Line 
1/** @file
2 * OpenGL: Common header for host service and guest clients.
3 */
4
5/*
6 * Copyright (C) 2006-2019 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef VBOX_INCLUDED_HostServices_VBoxOpenGLSvc_h
27#define VBOX_INCLUDED_HostServices_VBoxOpenGLSvc_h
28#ifndef RT_WITHOUT_PRAGMA_ONCE
29# pragma once
30#endif
31
32#include <VBox/VMMDevCoreTypes.h>
33#include <VBox/VBoxGuestCoreTypes.h>
34#include <VBox/hgcmsvc.h>
35
36/* OpenGL command buffer size */
37#define VBOX_OGL_MAX_CMD_BUFFER (128*1024)
38#define VBOX_OGL_CMD_ALIGN 4
39#define VBOX_OGL_CMD_ALIGN_MASK (VBOX_OGL_CMD_ALIGN-1)
40#define VBOX_OGL_CMD_MAGIC 0x1234ABCD
41
42/* for debugging */
43#define VBOX_OGL_CMD_STRICT
44
45/* OpenGL command block */
46typedef struct
47{
48#ifdef VBOX_OGL_CMD_STRICT
49 uint32_t Magic;
50#endif
51 uint32_t enmOp;
52 uint32_t cbCmd;
53 uint32_t cParams;
54 /* start of variable size parameter array */
55} VBOX_OGL_CMD, *PVBOX_OGL_CMD;
56
57typedef struct
58{
59#ifdef VBOX_OGL_CMD_STRICT
60 uint32_t Magic;
61#endif
62 uint32_t cbParam;
63 /* start of variable size parameter */
64} VBOX_OGL_VAR_PARAM, *PVBOX_OGL_VAR_PARAM;
65
66/** OpenGL Folders service functions. (guest)
67 * @{
68 */
69
70/** Query mappings changes. */
71#define VBOXOGL_FN_GLGETSTRING (1)
72#define VBOXOGL_FN_GLFLUSH (2)
73#define VBOXOGL_FN_GLFLUSHPTR (3)
74#define VBOXOGL_FN_GLCHECKEXT (4)
75
76/** @} */
77
78/** Function parameter structures.
79 * @{
80 */
81
82/**
83 * VBOXOGL_FN_GLGETSTRING
84 */
85
86/** Parameters structure. */
87typedef struct
88{
89 VBGLIOCHGCMCALL hdr;
90
91 /** 32bit, in: name
92 * GLenum name parameter
93 */
94 HGCMFunctionParameter name;
95
96 /** pointer, in/out
97 * Buffer for requested string
98 */
99 HGCMFunctionParameter pString;
100} VBoxOGLglGetString;
101
102/** Number of parameters */
103#define VBOXOGL_CPARMS_GLGETSTRING (2)
104
105
106
107/**
108 * VBOXOGL_FN_GLFLUSH
109 */
110
111/** Parameters structure. */
112typedef struct
113{
114 VBGLIOCHGCMCALL hdr;
115
116 /** pointer, in
117 * Command buffer
118 */
119 HGCMFunctionParameter pCmdBuffer;
120
121 /** 32bit, out: cCommands
122 * Number of commands in the buffer
123 */
124 HGCMFunctionParameter cCommands;
125
126 /** 64bit, out: retval
127 * uint64_t return code of last command
128 */
129 HGCMFunctionParameter retval;
130
131 /** 32bit, out: lasterror
132 * GLenum current last error
133 */
134 HGCMFunctionParameter lasterror;
135
136} VBoxOGLglFlush;
137
138/** Number of parameters */
139#define VBOXOGL_CPARMS_GLFLUSH (4)
140
141/**
142 * VBOXOGL_FN_GLFLUSHPTR
143 */
144
145/** Parameters structure. */
146typedef struct
147{
148 VBGLIOCHGCMCALL hdr;
149
150 /** pointer, in
151 * Command buffer
152 */
153 HGCMFunctionParameter pCmdBuffer;
154
155 /** 32bit, out: cCommands
156 * Number of commands in the buffer
157 */
158 HGCMFunctionParameter cCommands;
159
160 /** pointer, in
161 * Last command's final parameter memory block
162 */
163 HGCMFunctionParameter pLastParam;
164
165 /** 64bit, out: retval
166 * uint64_t return code of last command
167 */
168 HGCMFunctionParameter retval;
169
170 /** 32bit, out: lasterror
171 * GLenum current last error
172 */
173 HGCMFunctionParameter lasterror;
174
175} VBoxOGLglFlushPtr;
176
177/** Number of parameters */
178#define VBOXOGL_CPARMS_GLFLUSHPTR (5)
179
180
181/**
182 * VBOXOGL_FN_GLCHECKEXT
183 */
184
185/** Parameters structure. */
186typedef struct
187{
188 VBGLIOCHGCMCALL hdr;
189
190 /** pointer, in
191 * Extension function name
192 */
193 HGCMFunctionParameter pszExtFnName;
194
195} VBoxOGLglCheckExt;
196
197/** Number of parameters */
198#define VBOXOGL_CPARMS_GLCHECKEXT (1)
199
200/** @} */
201
202
203#endif /* !VBOX_INCLUDED_HostServices_VBoxOpenGLSvc_h */
204
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