Handmade Hero»Forums»Code
Jesse Coyle
37 posts
ChoosePixelFormat call time ~1.7 seconds
Any ideas what would make ChoosePixelFormat to take almost 2 seconds to call the first time? The only thing I can think of is that it has to change the desired pixel format pass-in. I say that because running it a second time (right after calling the first one and 5 seconds after calling the first one) results in about 0.8 milliseconds.

Is this acceptable? Has anyone had this happen?
Mārtiņš Možeiko
2562 posts / 2 projects
ChoosePixelFormat call time ~1.7 seconds
Edited by Mārtiņš Možeiko on
My guess would be on poorly written GPU drivers. And there's not much you can do about it. Once OS needs to initialize GPU related things, it starts communicating with driver, loading 20 dll files, enumerating 100 registry keys, etc... It takes time. Of course once it is done at least one time, next time will be much faster because all the information needed is already retrieved and cached.
Jesse Coyle
37 posts
ChoosePixelFormat call time ~1.7 seconds
That is... unfortunate. Thanks for letting me know!