Forget the texture as rendering target... It requires the use of OpenGL
extensions.
But, you can use glReadBuffer to get the bitmap data once your scene is
rendered. To do that, you to use a bouble buffer. The back buffer will never
be affected by sibling windows. So once you have finished the rendering, but
before you swap the buffers to put the back buffer in front, you can
retrieve the bitmap from this back buffer by a simple call to glReadBuffer.
The current source buffer should be the back buffer, but you can ensure that
by calling glReadBuffer. This bitmap can then be blitted to the printer
device context...
Then you can call glSwap and your current back buffer becomes the front
buffer and the old front buffer becomes the back buffer. Note that nothing
garantees that the back buffer contains coherent data once buffers have been
swapped. That's why you must retrieve the bitmap from the back buffer always
before the swap.
Guillaume Brocker
-----Message d'origine-----
ยทยทยท
De : Guillaume Brocker [mailto:guillaume.brocker@ircad.u-strasbg.fr]
Envoye : jeudi 7 aout 2003 08:43
A : wxPython-users@lists.wxwindows.org
Objet : RE: [wxPython-users] Capturing covered window area
Instead of doing the openGL rendering to the front buffer, you could use a
texture as the rendering target. You can then retrieve this texture as a
bitmap and perform the blit into the printer device context.
Guillaume Brocker
-----Message d'origine-----
De : Robin Dunn [mailto:robin@alldunn.com]
Envoye : mercredi 6 aout 2003 22:19
A : wxPython-users@lists.wxwindows.org
Objet : Re: [wxPython-users] Capturing covered window area
Andrew Jones wrote:
Is there any way to either make sure the entire area of a window is
visible, with no other windows above it, or to cause a wxWindowDC to see
the whole window even though part of it isn't visible? I'm trying to
print an object derived from a wxGLCanvas by calling Blit to a
wxPrinterDC from my object's wxWindowDC. The problem is if the printing
dialogs cover a portion of the object I want to print it causes that
portion of the object to be blank in the printout. Is there a way to
ensure I capture the entire window even if part of it isn't visible to
the screen?
Probabably not using this appraoch. You are seeing the platform
optimize the Blit to reduce flicker and elimiate the need to redraw the
other windows...
Or is there a better way to print objects I don't know
about? Is there anyway to set the device context an object draws to to
be a wxPrinterDC instead of the screen?
Normally you would just pass the wxPrinterDC to your draw method, but
since that is in OpenGL in this case (and I don't know OpenGL that much)
I'm not sure what to do. Is there any OpenGL functions to render a
canvas to an image or something?
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org