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