Changeset 3435 in vbox for trunk/src/VBox
- Timestamp:
- Jul 5, 2007 8:34:29 AM (18 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/gldrv.h
r3338 r3435 38 38 { 39 39 uint64_t lastretval; 40 uint32_t ulLastError; 41 42 bool fHasLastError; 40 43 41 44 uint8_t *pLastParam; -
trunk/src/VBox/HostServices/SharedOpenGL/glwindrv.cpp
r3434 r3435 144 144 void vboxglDrvCreateContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer) 145 145 { 146 HGLRC glrc ;146 HGLRC glrc = 0; 147 147 148 148 OGL_CMD(DrvCreateContext, 6); … … 178 178 uint32_t lasterr = glGetError(); 179 179 format = ChoosePixelFormat(pClient->hdc, &pfd); 180 lasterr = glGetError();181 180 SetPixelFormat(pClient->hdc, format, &pfd); 182 181 183 lasterr = glGetError();184 182 glrc = wglCreateContext(pClient->hdc); 185 lasterr = glGetError();186 183 Assert(glrc); 187 184 #else … … 190 187 #endif 191 188 192 pClient->lastretval = (uint64_t)glrc; 189 pClient->lastretval = (uint64_t)glrc; 190 pClient->fHasLastError = true; 191 pClient->ulLastError = GetLastError(); 193 192 } 194 193 195 194 void vboxglDrvSetContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer) 196 195 { 197 BOOL ret;198 199 196 OGL_CMD(DrvSetContext, 2); 200 197 OGL_PARAM(HDC, hdc); … … 203 200 Log(("DrvSetyContext %x %x\n", hdc, hglrc)); 204 201 #ifdef VBOX_OGL_DEBUG_WINDOW_OUTPUT 205 ret= wglMakeCurrent(pClient->hdc, hglrc);206 if (! ret)202 pClient->lastretval = wglMakeCurrent(pClient->hdc, hglrc); 203 if (!pClient->lastretval) 207 204 Log(("wglMakeCurrent failed with %d\n", GetLastError())); 208 205 #else 209 206 AssertFailed(); 210 207 #endif 208 pClient->fHasLastError = true; 209 pClient->ulLastError = GetLastError(); 211 210 } 212 211 … … 221 220 if (!pClient->lastretval) 222 221 Log(("wglCopyContext failed with %d\n", GetLastError())); 222 223 pClient->fHasLastError = true; 224 pClient->ulLastError = GetLastError(); 223 225 } 224 226 225 227 void vboxglDrvReleaseContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer) 226 228 { 227 BOOL ret;228 229 229 OGL_CMD(DrvReleaseContext, 1); 230 230 OGL_PARAM(HGLRC, hglrc); … … 232 232 Log(("DrvReleaseContext %x\n", hglrc)); 233 233 /* clear current selection */ 234 ret= wglMakeCurrent(pClient->hdc, NULL);235 if (! ret)234 pClient->lastretval = wglMakeCurrent(pClient->hdc, NULL); 235 if (!pClient->lastretval) 236 236 Log(("wglMakeCurrent failed with %d\n", GetLastError())); 237 pClient->fHasLastError = true; 238 pClient->ulLastError = GetLastError(); 237 239 } 238 240 239 241 void vboxglDrvDeleteContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer) 240 242 { 241 BOOL ret;242 243 243 OGL_CMD(DrvDeleteContext, 1); 244 244 OGL_PARAM(HGLRC, hglrc); 245 245 246 246 Log(("DrvDeleteContext %x\n", hglrc)); 247 ret= wglDeleteContext(hglrc);248 if (! ret)247 pClient->lastretval = wglDeleteContext(hglrc); 248 if (!pClient->lastretval) 249 249 Log(("wglDeleteContext failed with %d\n", GetLastError())); 250 pClient->fHasLastError = true; 251 pClient->ulLastError = GetLastError(); 250 252 } 251 253 252 254 void vboxglDrvCreateLayerContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer) 253 255 { 254 HGLRC glrc ;256 HGLRC glrc = 0; 255 257 256 258 OGL_CMD(DrvCreateLayerContext, 7); … … 295 297 AssertFailed(); 296 298 #endif 299 300 pClient->lastretval = (uint64_t)glrc; 301 pClient->fHasLastError = true; 302 pClient->ulLastError = GetLastError(); 297 303 } 298 304 … … 305 311 Log(("DrvShareLists %x %x\n", hglrc1, hglrc2)); 306 312 pClient->lastretval = wglShareLists(hglrc1, hglrc2); 313 pClient->fHasLastError = true; 314 pClient->ulLastError = GetLastError(); 307 315 } 308 316 … … 316 324 Log(("DrvRealizeLayerPalette %x %d %d\n", hdc, iLayerPlane, bRealize)); 317 325 pClient->lastretval = wglRealizeLayerPalette(VBOX_OGL_GUEST_TO_HOST_HDC(hdc), iLayerPlane, bRealize); 326 pClient->fHasLastError = true; 327 pClient->ulLastError = GetLastError(); 318 328 } 319 329 … … 325 335 Log(("DrvSwapLayerBuffers %x %d\n", hdc, fuPlanes)); 326 336 pClient->lastretval = wglSwapLayerBuffers(VBOX_OGL_GUEST_TO_HOST_HDC(hdc), fuPlanes); 337 pClient->fHasLastError = true; 338 pClient->ulLastError = GetLastError(); 327 339 } 328 340 … … 347 359 pClient->lastretval = 0; 348 360 } 361 pClient->fHasLastError = true; 362 pClient->ulLastError = GetLastError(); 349 363 } 350 364 … … 360 374 361 375 /** @todo sync bitmap/screen contents */ 376 pClient->fHasLastError = true; 377 pClient->ulLastError = GetLastError(); 362 378 } 363 379 … … 378 394 if (!pClient->lastretval) 379 395 Log(("wglDescribeLayerPlane failed with %d\n", GetLastError())); 396 pClient->fHasLastError = true; 397 pClient->ulLastError = GetLastError(); 380 398 } 381 399 … … 393 411 if (!pClient->lastretval) 394 412 Log(("wglSetLayerPaletteEntries failed with %d\n", GetLastError())); 413 pClient->fHasLastError = true; 414 pClient->ulLastError = GetLastError(); 395 415 } 396 416 … … 412 432 if (!pClient->lastretval) 413 433 Log(("wglGetLayerPaletteEntries failed with %d\n", GetLastError())); 434 pClient->fHasLastError = true; 435 pClient->ulLastError = GetLastError(); 414 436 } 415 437 … … 434 456 Log(("DescribePixelFormat failed with %d\n", GetLastError())); 435 457 458 pClient->fHasLastError = true; 459 pClient->ulLastError = GetLastError(); 460 436 461 if (!VBOX_OGL_GUEST_TO_HOST_HDC(hdc)) 437 462 ReleaseDC(0, pClient->hdc); -
trunk/src/VBox/HostServices/SharedOpenGL/vboxgl.cpp
r3428 r3435 114 114 Log(("vboxglFlushBuffer cCommands=%d cbCmdBuffer=%x\n", cCommands, cbCmdBuffer)); 115 115 116 pClient->fHasLastError = false; 117 116 118 for (i=0;i<cCommands;i++) 117 119 { … … 135 137 136 138 *pLastRetVal = pClient->lastretval; 137 *pLastError = 0; //glGetError(); 139 if (pClient->fHasLastError) 140 *pLastError = pClient->ulLastError; 141 else 142 *pLastError = glGetError(); 138 143 139 144 #ifdef DEBUG
Note:
See TracChangeset
for help on using the changeset viewer.