Changeset 34138 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Nov 17, 2010 2:29:56 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/glx.c
r34133 r34138 668 668 DECLEXPORT(GLXPixmap) VBOXGLXTAG(glXCreateGLXPixmap)( Display *dpy, XVisualInfo *vis, Pixmap pixmap ) 669 669 { 670 (void) dpy;671 (void) vis;672 (void) pixmap;673 674 670 stubInit(); 675 crWarning( "Unsupported GLX Call: glXCreateGLXPixmap()" ); 676 return (GLXPixmap) 0; 671 return VBOXGLXTAG(glXCreatePixmap)(dpy, (GLXFBConfig)vis->visualid, pixmap, NULL); 677 672 } 678 673 … … 1213 1208 1214 1209 case GLX_VERSION: 1215 retval = "1. 2Chromium";1210 retval = "1.3 Chromium"; 1216 1211 break; 1217 1212 … … 1241 1236 1242 1237 case GLX_VERSION: 1243 retval = "1. 2Chromium";1238 retval = "1.3 Chromium"; 1244 1239 break; 1245 1240 … … 1324 1319 int *attrib_list, int *nelements) 1325 1320 { 1326 (void) dpy; 1327 (void) screen; 1328 (void) attrib_list; 1329 (void) nelements; 1330 crWarning("glXChooseFBConfigSGIX not implemented by Chromium"); 1331 return NULL; 1321 return VBOXGLXTAG(glXChooseFBConfig)(dpy, screen, attrib_list, nelements); 1332 1322 } 1333 1323 … … 1337 1327 Pixmap pixmap) 1338 1328 { 1339 (void) dpy; 1340 (void) config; 1341 (void) pixmap; 1342 crWarning("glXCreateGLXPixmapWithConfigSGIX not implemented by Chromium"); 1343 return 0; } 1329 return VBOXGLXTAG(glXCreatePixmap)(dpy, config, pixmap, NULL); 1330 } 1344 1331 1345 1332 DECLEXPORT(GLXContext) … … 1349 1336 Bool direct) 1350 1337 { 1351 (void) dpy; 1352 (void) config; 1353 (void) render_type; 1354 (void) share_list; 1355 (void) direct; 1356 crWarning("glXCreateContextWithConfigSGIX not implemented by Chromium"); 1357 return NULL; 1338 if (render_type!=GLX_RGBA_TYPE_SGIX) 1339 { 1340 crWarning("glXCreateContextWithConfigSGIX: Unsupported render type %i", render_type); 1341 return NULL; 1342 } 1343 else 1344 { 1345 XVisualInfo *vis; 1346 GLXContext ret; 1347 1348 vis = VBOXGLXTAG(glXGetVisualFromFBConfigSGIX)(dpy, config); 1349 if (!vis) 1350 { 1351 crWarning("glXCreateContextWithConfigSGIX: no visuals for %p", config); 1352 return NULL; 1353 } 1354 ret = VBOXGLXTAG(glXCreateContext)(dpy, vis, share_list, direct); 1355 XFree(vis); 1356 return ret; 1357 } 1358 1358 } 1359 1359 … … 1362 1362 GLXFBConfig config) 1363 1363 { 1364 (void) dpy; 1365 (void) config; 1366 crWarning("glXGetVisualFromFBConfigSGIX not implemented by Chromium"); 1367 return NULL; 1364 return VBOXGLXTAG(glXGetVisualFromFBConfig)(dpy, config); 1368 1365 } 1369 1366 … … 1371 1368 VBOXGLXTAG(glXGetFBConfigFromVisualSGIX)(Display *dpy, XVisualInfo *vis) 1372 1369 { 1373 (void) dpy; 1374 (void) vis; 1375 crWarning("glXGetFBConfigFromVisualSGIX not implemented by Chromium"); 1376 return NULL; 1370 if (!vis) 1371 { 1372 return NULL; 1373 } 1374 /*Note: Caller is supposed to call XFree on returned value, so can't just return (GLXFBConfig)vis->visualid*/ 1375 return (GLXFBConfigSGIX) VBOXGLXTAG(glXGetVisualFromFBConfig)(dpy, (GLXFBConfig)vis->visualid); 1377 1376 } 1378 1377 … … 1380 1379 * GLX 1.3 functions 1381 1380 */ 1382 DECLEXPORT(GLXFBConfig *) 1381 DECLEXPORT(GLXFBConfig *) 1383 1382 VBOXGLXTAG(glXChooseFBConfig)(Display *dpy, int screen, ATTRIB_TYPE *attrib_list, int *nelements) 1384 1383 { 1385 (void) dpy; 1386 (void) screen; 1387 (void) attrib_list; 1388 (void) nelements; 1389 crWarning("glXChooseFBConfig not implemented by Chromium"); 1384 ATTRIB_TYPE *attrib; 1385 intptr_t fbconfig = 0; 1386 1387 stubInit(); 1388 1389 if (!attrib_list) 1390 { 1391 return VBOXGLXTAG(glXGetFBConfigs)(dpy, screen, nelements); 1392 } 1393 1394 for (attrib = attrib_list; *attrib != None; attrib++) 1395 { 1396 switch (*attrib) 1397 { 1398 case GLX_FBCONFIG_ID: 1399 fbconfig = attrib[1]; 1400 attrib++; 1401 break; 1402 1403 case GLX_BUFFER_SIZE: 1404 /* this is for color-index visuals, which we don't support */ 1405 goto err_exit; 1406 attrib++; 1407 break; 1408 1409 case GLX_LEVEL: 1410 if (attrib[1] != 0) 1411 goto err_exit; 1412 attrib++; 1413 break; 1414 1415 case GLX_AUX_BUFFERS: 1416 if (attrib[1] != 0) 1417 goto err_exit; 1418 attrib++; 1419 break; 1420 1421 case GLX_DOUBLEBUFFER: /* @todo, check if we support it */ 1422 attrib++; 1423 break; 1424 1425 case GLX_STEREO: 1426 if (attrib[1] != 0) 1427 goto err_exit; 1428 attrib++; 1429 break; 1430 1431 case GLX_RED_SIZE: 1432 case GLX_GREEN_SIZE: 1433 case GLX_BLUE_SIZE: 1434 case GLX_ALPHA_SIZE: 1435 if (attrib[1] > 8) 1436 goto err_exit; 1437 attrib++; 1438 break; 1439 1440 case GLX_DEPTH_SIZE: 1441 if (attrib[1] > 16) 1442 goto err_exit; 1443 attrib++; 1444 break; 1445 1446 case GLX_STENCIL_SIZE: 1447 if (attrib[1] > 8) 1448 goto err_exit; 1449 attrib++; 1450 break; 1451 1452 case GLX_ACCUM_RED_SIZE: 1453 case GLX_ACCUM_GREEN_SIZE: 1454 case GLX_ACCUM_BLUE_SIZE: 1455 case GLX_ACCUM_ALPHA_SIZE: 1456 if (attrib[1] > 16) 1457 goto err_exit; 1458 attrib++; 1459 break; 1460 1461 case GLX_X_RENDERABLE: 1462 case GLX_CONFIG_CAVEAT: 1463 attrib++; 1464 break; 1465 1466 case GLX_RENDER_TYPE: 1467 if (attrib[1]!=GLX_RGBA_BIT) 1468 goto err_exit; 1469 attrib++; 1470 break; 1471 1472 case GLX_DRAWABLE_TYPE: 1473 if (attrib[1]!=GLX_WINDOW_BIT) 1474 goto err_exit; 1475 attrib++; 1476 break; 1477 1478 case GLX_X_VISUAL_TYPE: 1479 case GLX_TRANSPARENT_TYPE_EXT: 1480 case GLX_TRANSPARENT_INDEX_VALUE_EXT: 1481 case GLX_TRANSPARENT_RED_VALUE_EXT: 1482 case GLX_TRANSPARENT_GREEN_VALUE_EXT: 1483 case GLX_TRANSPARENT_BLUE_VALUE_EXT: 1484 case GLX_TRANSPARENT_ALPHA_VALUE_EXT: 1485 /* ignore */ 1486 crWarning("glXChooseVisual: ignoring attribute 0x%x", *attrib); 1487 attrib++; 1488 break; 1489 1490 break; 1491 default: 1492 crWarning( "glXChooseVisual: bad attrib=0x%x, ignoring", *attrib ); 1493 attrib++; 1494 break; 1495 } 1496 } 1497 1498 if (fbconfig) 1499 { 1500 GLXFBConfig *pGLXFBConfigs; 1501 1502 *nelements = 1; 1503 pGLXFBConfigs = (GLXFBConfig *) crAlloc(*nelements * sizeof(GLXFBConfig)); 1504 pGLXFBConfigs[0] = (GLXFBConfig)fbconfig; 1505 return pGLXFBConfigs; 1506 } 1507 else 1508 { 1509 return VBOXGLXTAG(glXGetFBConfigs)(dpy, screen, nelements); 1510 } 1511 1512 err_exit: 1513 crWarning("glXChooseFBConfig returning NULL, due to attrib=0x%x, next=0x%x", attrib[0], attrib[1]); 1390 1514 return NULL; 1391 1515 } … … 1720 1844 case GLX_SAMPLES: 1721 1845 *value = 1; 1846 break; 1847 case GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT: 1848 *value = 0; 1722 1849 break; 1723 1850 default:
Note:
See TracChangeset
for help on using the changeset viewer.