pbuffer problems
i'm trying to write a small shadow mapping demo, but i've some problems with pbuffers :/ there's what i do:
after all the winmain stuff, before starting the render loop, i create the opengl window, set the pixelbuffer,create the window context and call InitGl() function. In this function i create an empty texture for the pbuffer (same size, it's obvious) and then i start to create this damned pbuffer. I set all the extensions needed,call wglChoosePixelFormatARB, wglCreatePbufferARB, wglGetPbufferDCARB and wglCreateContext, in this order. I get no error.
the problem is that when i call wglMakeCurrent, it returns FALSE and with GetLastError() i get ERROR_INVALID_PIXEL_FORMAT. What should i do now?
the bin and the sources can be found at:
http://www.neoborn.com/users/b3rs3rk/pbuffer.rar
I can't find anything wrong with it, the binary works just fine(allthough it only shows a black square on a blue background).
It might be the PFD for the window, on some cards you might need to use the same for pixel buffers, not on mine though(GF6800U).
try changing this line
pfd.cColorBits = 16;
to
pfd.cColorBits = 32;
in
CreateWindowGL()
Im not shure that this will work though, pbuffers works differently on different cards(it's a picedtogether extention anyway).
Fortunatly there is this.
http://www.opengl.org/documentation/extensions/EXT_framebuffer_object.txt
It will replace pbuffers compleatly.
It might be the PFD for the window, on some cards you might need to use the same for pixel buffers, not on mine though(GF6800U).
try changing this line
pfd.cColorBits = 16;
to
pfd.cColorBits = 32;
in
CreateWindowGL()
Im not shure that this will work though, pbuffers works differently on different cards(it's a picedtogether extention anyway).
Fortunatly there is this.
http://www.opengl.org/documentation/extensions/EXT_framebuffer_object.txt
It will replace pbuffers compleatly.
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
nothing.... but the strange thing is that i've used Nehe's basecode and the source found on codesampler in the off screen rendering demo.I've simply made copy and paste, nothing more...except having rearranged the pbuffer stuff in a class for more semplicity. But it's the same code..why in that demo works and not in my one?
how can i do to use the same PFD for pixel buffer?
how can i do to use the same PFD for pixel buffer?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement