# choosePixelFormat problem

**URL:** <https://discourse.glfw.org/t/choosepixelformat-problem/231>\
**Category:** support\
**Created:** [May 5, 2012, 2:30am UTC](https://discourse.glfw.org/t/choosepixelformat-problem/231 "2012-05-05T02:30:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [May 5, 2012, 2:30am UTC](https://discourse.glfw.org/t/choosepixelformat-problem/231/1 "2012-05-05T02:30:55Z")

</div>

**anonymous** wrote on [Saturday, May 05, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/b0e7b40a/#936e):

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [May 6, 2012, 11:31am UTC](https://discourse.glfw.org/t/choosepixelformat-problem/231/2 "2012-05-06T11:31:00Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Sunday, May 06, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/b0e7b40a/#b349):

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [May 6, 2012, 6:28pm UTC](https://discourse.glfw.org/t/choosepixelformat-problem/231/3 "2012-05-06T18:28:46Z")

</div>

**anonymous** wrote on [Sunday, May 06, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/b0e7b40a/#ad42):

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [May 6, 2012, 6:47pm UTC](https://discourse.glfw.org/t/choosepixelformat-problem/231/4 "2012-05-06T18:47:49Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Sunday, May 06, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/b0e7b40a/#096c):

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](http://msdn.microsoft.com/en-)  
us/library/dd368826(v=VS.85).aspx]([Microsoft Learn: Build skills that open doors in your career](http://msdn.microsoft.com/en-)  
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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [May 8, 2012, 2:39pm UTC](https://discourse.glfw.org/t/choosepixelformat-problem/231/5 "2012-05-08T14:39:32Z")

</div>

**anonymous** wrote on [Tuesday, May 08, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/b0e7b40a/#3484):

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