Skip to main content
GameDev.net gamedev.net
🔒 Locked

PBuffer Pain

Started by Thraddash Mar 20, 2003 at 2:15 AM 1 replies 650+ views
Original Post
Thraddash
Thraddash
I had a nice class set up encapsulating a pixelbuffer, and I have been trying to extend it so I can use it directly as a texture. After reading the docs, as far as I can tell this involves adding a few new attributes when I search for a pixel format, namely:
WGL_BIND_TO_TEXTURE_RGB_ARB = true
WGL_TEXTURE_FORMAT_ARB = WGL_TEXTURE_RGB
WGL_TEXTURE_TARGET_ARB = WGL_TEXTURE_2D_ARB 
Problem is, my program can't find a pixel format with all of these attributes. I'm running a GF4 Ti4400, which I'm pretty positive supports WGL_ARB_render_texture. The Pbuffer initialises fine if I omit the above attributes from the format search. Has anyone out there got any ideas what might be going wrong? [edited by - Thraddash on March 20, 2003 3:22:01 AM]
Crawl
Crawl
Those three attributes shouldn''t be added to your pixelformat discription, they are flags that need to be passed to wglCreatePbufferARB....

  
int iFlags[] = { WGL_PBUFFER_LARGEST_ARB, 1,
WGL_TEXTURE_FORMAT_ARB, WGL_TEXTURE_RGB_ARB,
WGL_TEXTURE_TARGET_ARB, WGL_TEXTURE_2D_ARB,
WGL_MIPMAP_TEXTURE_ARB, 1,
0 };

// try to create our p-buffer

m_hPBuffer = wglCreatePbufferARB( hCurrentDC, iPixelFormat,
iWidth, iHeight, iFlags );

taken from my pixelbuffer source which can be found here under opengl projects...

hope it helps....

-Crawl
--------
Thraddash
Thraddash
*smacks self in head for stupidity*

Yep. That fixed the problem. Thanks.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.