Window and offscreen rendering

Started by DavidYazel, July 06, 2003, 15:17:16

Previous topic - Next topic

DavidYazel

According to the documentation only one org.lwjgl.Window can exist at once.  

1. Does this mean one window per machine or per VM?  Is this limitation in the DLL or in the Java code?  If I had my app running twice would they conflict?

2. If I want to render into an offscreen buffer and not effect the currently displayed frame is that possible?  So basically I would render, read the color buffer back to app but not swap?

Thanks!

Dave

elias

The only-one-window is a design limitation to keep things simpler, like input. And it's an appreciation that almost any game will never need more than one window. Having two or more LWJGL apps running at the same time should not pose a problem.

Regarding offscreen rendering, yes, that's possible and you have two options:

1. Do the drawing to the back buffer and do a glCopyTexImage2D or similar.
2. Use Pbuffers coming in 0.7. Notice that render-to-texture is not supported yet, because a linux version of the extension is not available at the time. So you still need to do a glCopyTexImage2D.

- elias

DavidYazel

Thanks for the answer!

Bummer about render to texture, I could really use that.  Any idea when that will be in Linux?

elias

It wouldn't be that hard to implement on win32 only, but I figured users would be most interested in features widely available xplatform. As to when linux is ready, it really depends on the ARB. I know they have a GLX_render_texture in progress.

What do you need the offscreen rendering for? Copying to texture isn't so expensive as you might think - the transfer happens internally in AGP mem.

- elias

elias

And when do you need it? If it's not "yesterday, thank you very much", chances are the feature will be implemented at that point.

- elias

DavidYazel

I was going to use it for generating imposters dynamically, as well as building sphere and cube mapping textures for reflections.

It can wait a bit I am sure.

elias

That sounds suspiciously like an offline or non-interactive process. Why do you need render-to-texture for that?

- elias