VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/gllindrv.cpp@ 3491

Last change on this file since 3491 was 3471, checked in by vboxsync, 18 years ago

bugfix

File size: 5.8 KB
Line 
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 */
32int vboxglGlobalInit()
33{
34 vboxInitOpenGLExtensions();
35 return VINF_SUCCESS;
36}
37
38/**
39 * Client connect init
40 *
41 * @returns VBox error code
42 * @param pClient Client context
43 */
44int vboxglConnect(PVBOXOGLCTX pClient)
45{
46 return VINF_SUCCESS;
47}
48
49/**
50 * Client disconnect cleanup
51 *
52 * @returns VBox error code
53 * @param pClient Client context
54 */
55int vboxglDisconnect(PVBOXOGLCTX pClient)
56{
57 return VINF_SUCCESS;
58}
59
60/* Driver functions */
61void vboxglDrvCreateContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
62{
63 OGL_CMD(DrvCreateContext, 4);
64 OGL_PARAM(HDC, hdc);
65 OGL_PARAM(uint32_t, cx);
66 OGL_PARAM(uint32_t, cy);
67 OGL_PARAM(BYTE, cColorBits);
68 OGL_PARAM(BYTE, iPixelType);
69 OGL_PARAM(BYTE, cDepthBits);
70
71 pClient->lastretval = 0; /** @todo */
72}
73
74void vboxglDrvDeleteContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
75{
76 OGL_CMD(DrvDeleteContext, 1);
77 OGL_PARAM(HGLRC, hglrc);
78 /** @todo */
79 pClient->lastretval = 0; /** @todo */
80}
81
82void vboxglDrvSetContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
83{
84 OGL_CMD(DrvSetContext, 2);
85 OGL_PARAM(HDC, hdc);
86 OGL_PARAM(HGLRC, hglrc);
87
88 pClient->lastretval = 0; /** @todo */
89}
90
91void vboxglDrvCopyContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
92{
93 OGL_CMD(DrvDeleteContext, 3);
94 OGL_PARAM(HGLRC, hglrcSrc);
95 OGL_PARAM(HGLRC, hglrcDst);
96 OGL_PARAM(UINT, mask);
97 pClient->lastretval = 0; /** @todo */
98}
99
100void vboxglDrvReleaseContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
101{
102 OGL_CMD(DrvReleaseContext, 1);
103 OGL_PARAM(HGLRC, hglrc);
104 pClient->lastretval = 0; /** @todo */
105}
106
107void vboxglDrvCreateLayerContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
108{
109 OGL_CMD(DrvCreateLayerContext, 5);
110 OGL_PARAM(HDC, hdc);
111 OGL_PARAM(int, iLayerPlane);
112 OGL_PARAM(uint32_t, cx);
113 OGL_PARAM(uint32_t, cy);
114 OGL_PARAM(BYTE, cColorBits);
115 OGL_PARAM(BYTE, iPixelType);
116 OGL_PARAM(BYTE, cDepthBits);
117 AssertFailed();
118 /** @todo create memory dc with the parameters above */
119 pClient->lastretval = 0; /** @todo */
120}
121
122void vboxglDrvShareLists(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
123{
124 OGL_CMD(DrvShareLists, 3);
125 OGL_PARAM(HGLRC, hglrc1);
126 OGL_PARAM(HGLRC, hglrc2);
127 pClient->lastretval = 0; /** @todo */
128}
129
130
131void vboxglDrvRealizeLayerPalette(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
132{
133 OGL_CMD(DrvRealizeLayerPalette, 3);
134 OGL_PARAM(HDC, hdc);
135 OGL_PARAM(int, iLayerPlane);
136 OGL_PARAM(BOOL, bRealize);
137 pClient->lastretval = 0; /** @todo */
138}
139
140void vboxglDrvSwapLayerBuffers(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
141{
142 OGL_CMD(DrvSwapLayerBuffers, 2);
143 OGL_PARAM(HDC, hdc);
144 OGL_PARAM(UINT, fuPlanes);
145 pClient->lastretval = 0; /** @todo */
146}
147
148void vboxglDrvSetPixelFormat(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
149{
150 OGL_CMD(DrvSetPixelFormat, 2);
151 OGL_PARAM(HDC, hdc);
152 OGL_PARAM(int, iPixelFormat);
153
154 pClient->lastretval = 0; /** @todo */
155}
156
157void vboxglDrvSwapBuffers(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
158{
159 OGL_CMD(DrvSwapBuffers, 1);
160 OGL_PARAM(HDC, hdc);
161
162 pClient->lastretval = 0; /** @todo */
163}
164
165void vboxglDrvDescribeLayerPlane(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
166{
167 PLAYERPLANEDESCRIPTOR plpd;
168
169 OGL_CMD(DrvDescribeLayerPlane, 4);
170 OGL_PARAM(HDC, hdc);
171 OGL_PARAM(int, iPixelFormat);
172 OGL_PARAM(int, iLayerPlane);
173 OGL_PARAM(UINT, nBytes);
174 Assert(pClient->cbLastParam == nBytes);
175 plpd = (PLAYERPLANEDESCRIPTOR)pClient->pLastParam;
176
177 pClient->lastretval = 0; /** @todo */
178}
179
180void vboxglDrvSetLayerPaletteEntries(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
181{
182 OGL_CMD(DrvSetLayerPaletteEntries, 5);
183 OGL_PARAM(HDC, hdc);
184 OGL_PARAM(int, iLayerPlane);
185 OGL_PARAM(int, iStart);
186 OGL_PARAM(int, cEntries);
187 OGL_MEMPARAM(COLORREF, pcr);
188 pClient->lastretval = 0; /** @todo */
189}
190
191void vboxglDrvGetLayerPaletteEntries(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
192{
193 COLORREF *pcr;
194
195 OGL_CMD(DrvGetLayerPaletteEntries, 4);
196 OGL_PARAM(HDC, hdc);
197 OGL_PARAM(int, iLayerPlane);
198 OGL_PARAM(int, iStart);
199 OGL_PARAM(int, cEntries);
200
201 Assert(pClient->cbLastParam == sizeof(COLORREF)*cEntries);
202 pcr = (COLORREF *)pClient->pLastParam;
203 pClient->lastretval = 0; /** @todo */
204}
205
206void vboxglDrvDescribePixelFormat(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
207{
208 LPPIXELFORMATDESCRIPTOR ppfd;
209
210 OGL_CMD(DrvDescribePixelFormat, 3);
211 OGL_PARAM(HDC, hdc);
212 OGL_PARAM(int, iPixelFormat);
213 OGL_PARAM(UINT, nBytes);
214 Assert(pClient->cbLastParam == nBytes);
215 ppfd = (LPPIXELFORMATDESCRIPTOR)pClient->pLastParam;
216
217 pClient->lastretval = 0; /** @todo */
218}
219
220RTUINTPTR vboxDrvIsExtensionAvailable(char *pszExtFunctionName)
221{
222 return 0;
223}
224
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette