Help with PBuffers

Hello,

I am hoping someone can help me out with pbuffers. There is another thread called “Another PBuffer Thread” with some code that works on my machine. I then tried to recreate that code but mine would keep throwing one of those exceptions that says it’s native code and outside the vm. So after many trial and error tests I finally came up with using the Animator class on the glCanvas I was using. The code I copied used an Animator but since I plan not to use it my, test app didn’t include it. Well as a last resort I finally put Animator in my test and my code then started to work. What I don’t understand is why it works with animator but not without ( Reading the javadoc for animator it appears a new rendering thread is created, could it have something to do with that?). I would like to use active rendering where I control the animating loop and don’t want to use animator (altough maybe I am supposed to). Anyone have any insight? Do I have to use animator or should it work without that class?

Thanks,
Steve

You need to make sure that you call display() on the parent GLCanvas until the pbuffer is fully created (i.e., when the init() method is called on the GLEventListener associated with the pbuffer). At that point you can start drawing into the pbuffer. On the other hand, calling display() on the pbuffer shouldn’t cause a crash if it hasn’t been fully created – it should only ignore the request to draw.

Hi,

Thanks for the help, I ended up having to call setRenderingThread(Thread) and then my pbuffer worked.

,
steve