how to copyrect the frontbuffer?

Blitz3D Forums/Blitz3D Programming/how to copyrect the frontbuffer?

NeuralizR(Posted 2003) [#1]
So, I've been trying to figure out how to render the scene, then copy that to another image to use as a texture. I've tried copyrect on the frontbuffer to a texturebuffer, to an image that I used to texture an item and tried copying from teh backbuffer before rendering.

How would one accomplish this in a WORKING fashion? :P


GfK(Posted 2003) [#2]
Do this BEFORE 'Flip' but AFTER 'RenderWorld'.
Copyrect 0,0,256,256,0,0,BackBuffer(),TextureBuffer(Texture)

There are some texture flag combinations that I found would prevent this from working - I can't remember what they were tho. :P


Floyd(Posted 2003) [#3]
The 3D sample program in \mak\tex_render\ does this.


Ross C(Posted 2003) [#4]
when copying, use the 256 flag on the texture. Makes operations go alot faster. All graphics cards don't support this however.


podperson(Posted 2003) [#5]
256 flags work really well unless you, for example, want to perform text operations on them.


Ziltch(Posted 2003) [#6]
If you render to the backbuffer,copyrect and not do a flip,
Then the texture being created does not appear to the user as a screen image. This looks more professional.

Just have a flip in your code for debuging and remove it before release.


NeuralizR(Posted 2003) [#7]
(in response to the "more professional" comment)

The point of this actually, was to use the previously rendered frame in the next frame.