Multiple rendering contexts problems

l_belev: If I only use one RC, it does not render to the viewports correctly.

what do you mean? how is it not correct? I think you should be investigating that. l_belev is right, you shouldn’t be using multiple render targets for all of the reasons he mentioned (and more importantly it’s not needed here). If all you’re trying to do is render multiple views all you need to do is render the scene once for each view and change the viewport and camera position/rotation for each view.

I don’t think you’re going about this the right way.

so smaller sub-windows would not be accelerated anyway, right?

I don’t think that’s true.

Originally posted by Jason666:
In my past OpenGL apps, to get hardware acceleration I had to use fullscreen mode, so smaller sub-windows would not be accelerated anyway, right?

That was true in the days of Voodoo2’s. It hasn’t been the case for quite some time though.

I would recommend you look at some of the examples on delphi 3d and see how Tom does it. I would expect that with Delphi you should be able to override the WM_PAINT event to overcome any problems that message may create.

Even if you render into several separate bitmaps and/or windows, you still can use only one context. There is no necessity for one-to-one correspondence between the contexts and the drawables (windows/bitmaps/pbuffers) if they are compatible (have identical pixel formats). The rendering context is exactly the aggregate of all the rendering states - this and nothing else. It is not bound to a particular drawable - you can use one context with many drawables and many contexts with single drawable (only not simultaneously).

Unless I use a unique DC and RC for the calls

cameraRC:=wglCreateContext(cameradc);
leftRC:=wglCreateContext(leftDC);
etc

Then the windows show up blank or 3 blank and one that half renders the image with incorrect colors.

I will have a look at Delphi3D and see if I can get any ideas/hints from there.

If it is possible to get accelerated displays in non full-screen windows I am definately interested.

Thanks for the pointers,
Jason.

Originally posted by Jason666:
zeckensack: That C stuff has no meaning to a Delphi app. Well it may, but it is well hidden in the background, so I never have needed to manually worry about the window api creation stuff.

It’s not C stuff. It’s standard Windows programming. There is a difference between programming language and a API.

You absolutly need it for Win9x generation.
For WinNT generation, I don’t know, but I would recommend putting it in.

There isn’t much point in rendering to a bitmap anymore, if ever. You can copy the framebuffer to a texture, and render the scene with a texture mapped quad.