choosePixelFormat problem

anonymous wrote on Saturday, May 05, 2012:

Hello
I met strange crash with glfw2.7 and windows xp. The console output shows:

Failed to select a GLFWFBConfig from the alternatives
Unable to find a usable pixel format
Failed to create GLFW window

This is very weird. I started to read glfw source code and looks like
_glfwChooseFBConfig function works bad. Since console dosn’t output “Failed
to find any usable GLFWFBConfigs” so i guess that some GLWFBConfigs were
found. So the main question is why _glfwChooseFBConfig returns zero? Function
body looks quite clear and only way to skip FB is to request desired
Framebuffer to support stereo rendering. But I am not doing that. My code:

glfwInit();
glfwOpenWindowHint(GLFW_FSAA_SAMPLES, 4);
glfwSwapInterval(1);
glfwOpenWindow(800,600,0,0,0,8,32,0, 0);

I’m really confused about this. Any Ideas?

elmindreda wrote on Sunday, May 06, 2012:

I believe it’s due to a missing check for whether or not any GLFWFBConfigs
passed all the checks in getFBConfigs, i.e. it’s returning an array with zero
valid entries.

A fix has been committed to the Subversion repository and will be included in
2.7.6.

As for why no pixel formats were considered valid… are you sure you have
OpenGL-capable drivers installed?

anonymous wrote on Sunday, May 06, 2012:

ahh now I see, this condition checks If there is array returned, not total
size of acceptable pixel formats.
And one more thing, I am not an expert but aren’t this checks in getFBConfigs
too restrictive (PFD_GENERIC_ACCELERATED , PFD_GENERIC_FORMAT)? I am
only speculating

elmindreda wrote on Sunday, May 06, 2012:

I believe it is correct. From the MSDN library page on PIXELFORMATDESCRIPTOR:

If is clear and the PFD_GENERIC_FORMAT flag is set, the pixel format is
supported by the generic implementation only.

[Microsoft Learn: Build skills that open doors in your career
us/library/dd368826(v=VS.85).aspx](Microsoft Learn: Build skills that open doors in your career
us/library/dd368826%28v=VS.85%29.aspx)

GLFW 2.x should not return contexts using the generic implementation, so this
appears to be correct.

Are you sure you have an OpenGL-capable card with OpenGL-capable drivers
installed?

anonymous wrote on Tuesday, May 08, 2012:

yeah obviously you have right, that was about drivers.
Thanks for Your support and keep developing such great library!