Changeset 65563 in vbox for trunk/src/VBox/Additions/common/crOpenGL
- Timestamp:
- Feb 1, 2017 11:51:44 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/glx.c
r65537 r65563 426 426 427 427 case GLX_USE_GL: 428 *value = 1;428 *value = vis->visualid == XVisualIDFromVisual(DefaultVisual(dpy, vis->screen)); 429 429 break; 430 430 … … 1004 1004 { 1005 1005 ATTRIB_TYPE *attrib; 1006 XVisualInfo *pVis;1007 1006 GLX_Pixmap_t *pGlxPixmap; 1008 1007 (void) dpy; … … 1040 1039 } 1041 1040 1042 pVis = VBOXGLXTAG(glXGetVisualFromFBConfig)(dpy, config); 1043 if (!pVis) 1044 { 1045 crWarning("Unknown config %p in glXCreatePixmap", config); 1046 return 0; 1047 } 1048 1049 pGlxPixmap->format = pVis->depth==24 ? GL_RGB:GL_RGBA; 1041 pGlxPixmap->format = GL_RGBA; 1050 1042 pGlxPixmap->target = GL_TEXTURE_2D; 1051 1043 … … 1224 1216 break; 1225 1217 case GLX_BIND_TO_TEXTURE_RGBA_EXT: 1226 *value = pVisual->depth==32;1218 *value = True; 1227 1219 break; 1228 1220 case GLX_BIND_TO_TEXTURE_RGB_EXT: … … 1238 1230 case GLX_ALPHA_SIZE: 1239 1231 //crDebug("attribute=GLX_ALPHA_SIZE"); 1240 *value = pVisual->depth==32 ? 8:0;1232 *value = 8; 1241 1233 break; 1242 1234 case GLX_BUFFER_SIZE: 1243 1235 //crDebug("attribute=GLX_BUFFER_SIZE"); 1244 *value = pVisual->depth;1236 *value = 32; 1245 1237 break; 1246 1238 case GLX_STENCIL_SIZE: … … 1313 1305 } 1314 1306 1315 #if !defined(VBOX_NO_NATIVEGL) || 1 /* need fbconfigs atleast for depths 24 and 32 */1316 DECLEXPORT(GLXFBConfig *) VBOXGLXTAG(glXGetFBConfigs)(Display *dpy, int screen, int *nelements)1317 {1318 GLXFBConfig *pGLXFBConfigs = NULL;1319 /*struct VisualInfo *v; */1320 int i=0;1321 XVisualInfo searchvis, *pVisuals;1322 1323 *nelements = 0;1324 1325 /*1326 for (v = VisualInfoList; v; v = v->next) {1327 if (v->dpy == dpy && v->screen == screen)1328 ++*nelements;1329 }1330 1331 if (*nelements)1332 pGLXFBConfigs = crAlloc(*nelements * sizeof(GLXFBConfig));1333 1334 for (v = VisualInfoList; v && i<*nelements; v = v->next) {1335 if (v->dpy == dpy && v->screen == screen)1336 pGLXFBConfigs[i++] = (GLXFBConfig) v->visualid;1337 }1338 */1339 1340 /*@todo doesn't really list all the common visuals, have to use some static list*/1341 searchvis.screen = screen;1342 XLOCK(dpy);1343 pVisuals = XGetVisualInfo(dpy, VisualScreenMask, &searchvis, nelements);1344 XUNLOCK(dpy);1345 1346 if (*nelements)1347 pGLXFBConfigs = crAlloc(*nelements * sizeof(GLXFBConfig));1348 1349 for (i=0; i<*nelements; ++i)1350 {1351 pGLXFBConfigs[i] = (GLXFBConfig) pVisuals[i].visualid;1352 }1353 1354 XFree(pVisuals);1355 1356 crDebug("glXGetFBConfigs returned %i configs", *nelements);1357 for (i=0; i<*nelements; ++i)1358 {1359 crDebug("glXGetFBConfigs[%i]=%p", i, pGLXFBConfigs[i]);1360 }1361 return pGLXFBConfigs;1362 }1363 #else /* not 0 */1364 1307 DECLEXPORT(GLXFBConfig *) VBOXGLXTAG(glXGetFBConfigs)(Display *dpy, int screen, int *nelements) 1365 1308 { … … 1376 1319 for (i=0; i<*nelements; ++i) 1377 1320 { 1378 crDebug("glXGetFBConfigs[%i]=0x%x", i, (unsigned int) pGLXFBConfigs[i]);1321 crDebug("glXGetFBConfigs[%i]=0x%x", i, (unsigned)(uintptr_t) pGLXFBConfigs[i]); 1379 1322 } 1380 1323 return pGLXFBConfigs; 1381 1324 } 1382 #endif1383 1325 1384 1326 DECLEXPORT(void) VBOXGLXTAG(glXGetSelectedEvent)(Display *dpy, GLXDrawable draw, unsigned long *event_mask)
Note:
See TracChangeset
for help on using the changeset viewer.