PDA

View Full Version : dxdraw.flip - Which surface?



Damot
03-11-2003, 07:31 PM
Hi all,

I want to save a screenshot into a bitmap. However, I want to make sure the the image is that of what is being *displayed* not what I'm drawing on at the moment (dxflip enabled).

How do I find out which surface I'm on and how do I read from it?

Any thoughts?

Damot

cairnswm
04-11-2003, 08:03 AM
Have a look at this topic where I asked the same question.

http://terraqueous.f2o.org/dgdev/viewtopic.php?t=288

Alimonster
04-11-2003, 08:28 AM
I'll add that the currently visible frame is on the front (primary) surface, since you're always drawing onto the back (secondary) surface. Page flipping is simply a quick way to swap between two surfaces. I'm not sure, since I've not tried, but you should be able to draw the primary surface onto a temp surface you created (perhaps with a big speed hit, but I've never tried it).

Damot
04-11-2003, 10:08 AM
Have a look at this topic where I asked the same question.

http://terraqueous.f2o.org/dgdev/viewtopic.php?t=288


Yes, thanks for that, I did see your post and I was already doing the same thing. But, you will find that this can cause problems.

You are saving the current surface you are working with, *not* what is already on the screen already (from the previous flip). So sometimes if your screen has changed a lot the user gets a screen shot of events just after what was on the screen, not what is *actually* visible to him/her.

Damot
04-11-2003, 10:10 AM
I'll add that the currently visible frame is on the front (primary) surface, since you're always drawing onto the back (secondary) surface. Page flipping is simply a quick way to swap between two surfaces. I'm not sure, since I've not tried, but you should be able to draw the primary surface onto a temp surface you created (perhaps with a big speed hit, but I've never tried it).

Thats my problem. How do I access what is *actually* visible rather than what I'm working with before a flip? Any ideas?

cairnswm
04-11-2003, 11:33 AM
My feeling was that the user was wanting to see what was currently happening and as there is a refresh every 20ms the difference would be practically nothing.

I think the canvas you are looking for is:


DXDraw.Primary.Canvas.