choosePixelFormat problem

anonymous wrote on Saturday, May 05, 2012:

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:

glfwOpenWindowHint(GLFW_FSAA_SAMPLES, 4);
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

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
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.


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

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!