EglDisplayImpl::EglDisplayImpl() : initialized_(false), invalidated_(false), color_buffers_locked_(0), global_context_(NULL), window_(NULL) { ConfigsList configs; Native::QueryConfigs(&configs); // Start at 1 since 0 is EGL_NO_CONFIG. int id = 1; for (ConfigsList::iterator it = configs.begin(); it != configs.end(); ++it) { configs_.insert(EglConfigImpl(id, *it)); ++id; } }
void queryConfigs(EGLNativeDisplayType dpy,int renderableType,ConfigsList& listOut) { int n; EGLNativePixelFormatType* frmtList = glXGetFBConfigs(dpy,0,&n); for(int i =0 ;i < n ; i++) { EglConfig* conf = pixelFormatToConfig(dpy,renderableType,&frmtList[i]); if(conf) listOut.push_back(conf); } XFree(frmtList); }
void queryConfigs(EGLNativeInternalDisplayType display,int renderableType,ConfigsList& listOut) { PIXELFORMATDESCRIPTOR pfd; int iPixelFormat = 1; HDC dpy = getDummyDC(display,WinDisplay::DEFAULT_DISPLAY); // // We need to call wglChoosePixelFormat at least once, // seems that the driver needs to initialize itself. // do it here during initialization. // initPixelFormat(dpy); //quering num of formats int nFormats = DescribePixelFormat(dpy, iPixelFormat,sizeof(PIXELFORMATDESCRIPTOR), &pfd); //inserting rest of formats for(iPixelFormat;iPixelFormat < nFormats; iPixelFormat++) { DescribePixelFormat(dpy, iPixelFormat,sizeof(PIXELFORMATDESCRIPTOR), &pfd); EglConfig* pConfig = pixelFormatToConfig(display,renderableType,&pfd,iPixelFormat); if(pConfig) listOut.push_back(pConfig); } }