1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox OpenGL
|
---|
4 | *
|
---|
5 | * Simple buffered OpenGL functions
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
10 | *
|
---|
11 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
12 | * available from http://www.virtualbox.org. This file is free software;
|
---|
13 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
14 | * General Public License as published by the Free Software Foundation,
|
---|
15 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
16 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
17 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
18 | *
|
---|
19 | * If you received this file as part of a commercial VirtualBox
|
---|
20 | * distribution, then only the terms of your commercial VirtualBox
|
---|
21 | * license agreement apply instead of the previous paragraph.
|
---|
22 | *
|
---|
23 | */
|
---|
24 |
|
---|
25 | #include "vboxgl.h"
|
---|
26 | #define LOG_GROUP LOG_GROUP_SHARED_OPENGL
|
---|
27 | #include <VBox/log.h>
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * Global init of VBox OpenGL for windows
|
---|
31 | *
|
---|
32 | * @returns VBox error code
|
---|
33 | */
|
---|
34 | int vboxglGlobalInit()
|
---|
35 | {
|
---|
36 | vboxInitOpenGLExtensions();
|
---|
37 | return VINF_SUCCESS;
|
---|
38 | }
|
---|
39 |
|
---|
40 | /**
|
---|
41 | * Client connect init
|
---|
42 | *
|
---|
43 | * @returns VBox error code
|
---|
44 | * @param pClient Client context
|
---|
45 | */
|
---|
46 | int vboxglConnect(PVBOXOGLCTX pClient)
|
---|
47 | {
|
---|
48 | return VINF_SUCCESS;
|
---|
49 | }
|
---|
50 |
|
---|
51 | /**
|
---|
52 | * Client disconnect cleanup
|
---|
53 | *
|
---|
54 | * @returns VBox error code
|
---|
55 | * @param pClient Client context
|
---|
56 | */
|
---|
57 | int vboxglDisconnect(PVBOXOGLCTX pClient)
|
---|
58 | {
|
---|
59 | return VINF_SUCCESS;
|
---|
60 | }
|
---|
61 |
|
---|
62 | /* Driver functions */
|
---|
63 | void vboxglDrvCreateContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
|
---|
64 | {
|
---|
65 | OGL_CMD(DrvCreateContext, 4);
|
---|
66 | OGL_PARAM(HDC, hdc);
|
---|
67 | OGL_PARAM(uint32_t, cx);
|
---|
68 | OGL_PARAM(uint32_t, cy);
|
---|
69 | OGL_PARAM(BYTE, cColorBits);
|
---|
70 | OGL_PARAM(BYTE, iPixelType);
|
---|
71 | OGL_PARAM(BYTE, cDepthBits);
|
---|
72 |
|
---|
73 | pClient->lastretval = 0; /** @todo */
|
---|
74 | }
|
---|
75 |
|
---|
76 | void vboxglDrvDeleteContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
|
---|
77 | {
|
---|
78 | OGL_CMD(DrvDeleteContext, 1);
|
---|
79 | OGL_PARAM(HGLRC, hglrc);
|
---|
80 | /** @todo */
|
---|
81 | pClient->lastretval = 0; /** @todo */
|
---|
82 | }
|
---|
83 |
|
---|
84 | void vboxglDrvSetContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
|
---|
85 | {
|
---|
86 | OGL_CMD(DrvSetContext, 2);
|
---|
87 | OGL_PARAM(HDC, hdc);
|
---|
88 | OGL_PARAM(HGLRC, hglrc);
|
---|
89 |
|
---|
90 | pClient->lastretval = 0; /** @todo */
|
---|
91 | }
|
---|
92 |
|
---|
93 | void vboxglDrvCopyContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
|
---|
94 | {
|
---|
95 | OGL_CMD(DrvDeleteContext, 3);
|
---|
96 | OGL_PARAM(HGLRC, hglrcSrc);
|
---|
97 | OGL_PARAM(HGLRC, hglrcDst);
|
---|
98 | OGL_PARAM(UINT, mask);
|
---|
99 | pClient->lastretval = 0; /** @todo */
|
---|
100 | }
|
---|
101 |
|
---|
102 | void vboxglDrvReleaseContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
|
---|
103 | {
|
---|
104 | OGL_CMD(DrvReleaseContext, 1);
|
---|
105 | OGL_PARAM(HGLRC, hglrc);
|
---|
106 | pClient->lastretval = 0; /** @todo */
|
---|
107 | }
|
---|
108 |
|
---|
109 | void vboxglDrvCreateLayerContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
|
---|
110 | {
|
---|
111 | OGL_CMD(DrvCreateLayerContext, 5);
|
---|
112 | OGL_PARAM(HDC, hdc);
|
---|
113 | OGL_PARAM(int, iLayerPlane);
|
---|
114 | OGL_PARAM(uint32_t, cx);
|
---|
115 | OGL_PARAM(uint32_t, cy);
|
---|
116 | OGL_PARAM(BYTE, cColorBits);
|
---|
117 | OGL_PARAM(BYTE, iPixelType);
|
---|
118 | OGL_PARAM(BYTE, cDepthBits);
|
---|
119 | AssertFailed();
|
---|
120 | /** @todo create memory dc with the parameters above */
|
---|
121 | pClient->lastretval = 0; /** @todo */
|
---|
122 | }
|
---|
123 |
|
---|
124 | void vboxglDrvShareLists(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
|
---|
125 | {
|
---|
126 | OGL_CMD(DrvShareLists, 3);
|
---|
127 | OGL_PARAM(HGLRC, hglrc1);
|
---|
128 | OGL_PARAM(HGLRC, hglrc2);
|
---|
129 | pClient->lastretval = 0; /** @todo */
|
---|
130 | }
|
---|
131 |
|
---|
132 |
|
---|
133 | void vboxglDrvRealizeLayerPalette(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
|
---|
134 | {
|
---|
135 | OGL_CMD(DrvRealizeLayerPalette, 3);
|
---|
136 | OGL_PARAM(HDC, hdc);
|
---|
137 | OGL_PARAM(int, iLayerPlane);
|
---|
138 | OGL_PARAM(BOOL, bRealize);
|
---|
139 | pClient->lastretval = 0; /** @todo */
|
---|
140 | }
|
---|
141 |
|
---|
142 | void vboxglDrvSwapLayerBuffers(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
|
---|
143 | {
|
---|
144 | OGL_CMD(DrvSwapLayerBuffers, 2);
|
---|
145 | OGL_PARAM(HDC, hdc);
|
---|
146 | OGL_PARAM(UINT, fuPlanes);
|
---|
147 | pClient->lastretval = 0; /** @todo */
|
---|
148 | }
|
---|
149 |
|
---|
150 | void vboxglDrvSetPixelFormat(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
|
---|
151 | {
|
---|
152 | OGL_CMD(DrvSetPixelFormat, 2);
|
---|
153 | OGL_PARAM(HDC, hdc);
|
---|
154 | OGL_PARAM(int, iPixelFormat);
|
---|
155 |
|
---|
156 | pClient->lastretval = 0; /** @todo */
|
---|
157 | }
|
---|
158 |
|
---|
159 | void vboxglDrvSwapBuffers(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
|
---|
160 | {
|
---|
161 | OGL_CMD(DrvSwapBuffers, 1);
|
---|
162 | OGL_PARAM(HDC, hdc);
|
---|
163 |
|
---|
164 | pClient->lastretval = 0; /** @todo */
|
---|
165 | }
|
---|
166 |
|
---|
167 | void vboxglDrvDescribeLayerPlane(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
|
---|
168 | {
|
---|
169 | PLAYERPLANEDESCRIPTOR plpd;
|
---|
170 |
|
---|
171 | OGL_CMD(DrvDescribeLayerPlane, 4);
|
---|
172 | OGL_PARAM(HDC, hdc);
|
---|
173 | OGL_PARAM(int, iPixelFormat);
|
---|
174 | OGL_PARAM(int, iLayerPlane);
|
---|
175 | OGL_PARAM(UINT, nBytes);
|
---|
176 | Assert(pClient->cbLastParam == nBytes);
|
---|
177 | plpd = (PLAYERPLANEDESCRIPTOR)pClient->pLastParam;
|
---|
178 |
|
---|
179 | pClient->lastretval = 0; /** @todo */
|
---|
180 | }
|
---|
181 |
|
---|
182 | void vboxglDrvSetLayerPaletteEntries(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
|
---|
183 | {
|
---|
184 | OGL_CMD(DrvSetLayerPaletteEntries, 5);
|
---|
185 | OGL_PARAM(HDC, hdc);
|
---|
186 | OGL_PARAM(int, iLayerPlane);
|
---|
187 | OGL_PARAM(int, iStart);
|
---|
188 | OGL_PARAM(int, cEntries);
|
---|
189 | OGL_MEMPARAM(COLORREF, pcr);
|
---|
190 | pClient->lastretval = 0; /** @todo */
|
---|
191 | }
|
---|
192 |
|
---|
193 | void vboxglDrvGetLayerPaletteEntries(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
|
---|
194 | {
|
---|
195 | COLORREF *pcr;
|
---|
196 |
|
---|
197 | OGL_CMD(DrvGetLayerPaletteEntries, 4);
|
---|
198 | OGL_PARAM(HDC, hdc);
|
---|
199 | OGL_PARAM(int, iLayerPlane);
|
---|
200 | OGL_PARAM(int, iStart);
|
---|
201 | OGL_PARAM(int, cEntries);
|
---|
202 |
|
---|
203 | Assert(pClient->cbLastParam == sizeof(COLORREF)*cEntries);
|
---|
204 | pcr = (COLORREF *)pClient->pLastParam;
|
---|
205 | pClient->lastretval = 0; /** @todo */
|
---|
206 | }
|
---|
207 |
|
---|
208 | void vboxglDrvDescribePixelFormat(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
|
---|
209 | {
|
---|
210 | LPPIXELFORMATDESCRIPTOR ppfd;
|
---|
211 |
|
---|
212 | OGL_CMD(DrvDescribePixelFormat, 3);
|
---|
213 | OGL_PARAM(HDC, hdc);
|
---|
214 | OGL_PARAM(int, iPixelFormat);
|
---|
215 | OGL_PARAM(UINT, nBytes);
|
---|
216 | Assert(pClient->cbLastParam == nBytes);
|
---|
217 | ppfd = (LPPIXELFORMATDESCRIPTOR)pClient->pLastParam;
|
---|
218 |
|
---|
219 | pClient->lastretval = 0; /** @todo */
|
---|
220 | }
|
---|
221 |
|
---|
222 | RTUINTPTR vboxDrvIsExtensionAvailable(char *pszExtFunctionName)
|
---|
223 | {
|
---|
224 | return 0;
|
---|
225 | }
|
---|
226 |
|
---|