PDA

View Full Version : PBuffer lost after I create a new Render context.



dan59314
07-01-2008, 06:05 AM
Hi,

I have a MainForm and a PBuffer, I first create RC for the mainform and create RC for PBuffer, then use wglShareLists() to make them share the same resource.

I can render to PBuffer without problem if I don't create another RC. But If I create anoter form and create RC for it, then ShowModal. After I destroy the form, the PBuffer seems lost, can't get it rendered any more.

Any one can help?

Thanks,

Daniel

dan59314
14-01-2008, 01:53 AM
Hi,


>> I can render to PBuffer without problem if I don't create another RC. But If I create anoter form and create RC for it, then ShowModal. After I destroy the form, the PBuffer seems lost, can't get it rendered any more.

Actually, I guess the pBuffer didn't lost, just render nothing, empty black.

After I create a new form and RC. The texture disapear, can't be shared by this new RC. After I free this form and RC, the pBuffer was affected to render nothing. Why pBuffer was affected?

Brieflly,
1. How can I make the later-created form share the same resource?
2. How to recover the PBuffer to render correctlly after create a new form and RC?

May someone point me why and how for these problem? Thank you.

User137
14-01-2008, 02:12 AM
Now, i never used pbuffer but just guesses...

If PBuffer isn't showing anything should you make sure it has an RC after you remove 1 of your many? Recall previous one maybe on form destroy, and unshare stuff that don't exist.

dan59314
15-01-2008, 07:43 AM
>>If PBuffer isn't showing anything should you make sure it has an RC after you remove 1 of your many? Recall previous one maybe on form destroy, and unshare stuff that don't exist.



Yes, I recall previous RC(MainForm) after I destroy new-created form. So I can make my mainform RC acived again.

But I than get empty dark while I render on pBuffer again.

p.s. Without createing new form, I can repeat again and again... to render on pBuffer and recall MainForm RC with no problem.


Daniel