PDA

View Full Version : Texture data lost after create pbuffer and make it current



dan59314
17-12-2007, 01:18 AM
Hi,

I started trying pbuffer recentlly and met some problem.

I want to render my current scene to a pbuffer( 4096 x 4096 ) and save it to a bmp file while I want to. So I crate pbuffer and release pbuffer inside a function.

After create pbuffer and make it current. I enable the light again, render my models ( with textures). I then save scene to file to see the result.

The result show no texture, just plain, smooth shaded models. I wonder the texture data might missing after I create pbuffer.

Is there any function that I can lock texture data while create pbuffer? Or how should I prevent the texture from misssing?

Thanks,

Daniel

User137
17-12-2007, 03:00 AM
Although i have never heard of pbuffer before, quick googling gave out info to look for wglShareLists.
http://msdn2.microsoft.com/en-us/library/ms537565.aspx
also tips:
http://forum.beyond3d.com/archive/index.php/t-9262.html

Good night :wink:

ps. just reached end of reading upto the final naruto manga... so sad ending.

dan59314
17-12-2007, 10:10 AM
Hi, User137,

Thanks, it works.

wgl ShareList() can let window RC and pbuffer RC share the same texture data.

Note. wglShareList() must called right after WindowRC and pbuffer RC created, before calling glGenTexture, glGenList......etc.

Daniel

dan59314
18-12-2007, 12:29 AM
By the way, If I want to change the pbuffer Width and height. How can I do it without recreate pBuffer?


Thanks,

Daniel


http://dan59314.myweb.hinet.net