PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Surface clipping

Hello,

I'm new to PF, so sorry if this is a dumb question, but does PF clip a surface if part (or all of it) is off-screen?

From frame testing I've done this seems to be the case as performace increases when a sprite is partly offscreen. I just want to make sure :)

Thx
Hello Alex, I don't know the answer but wanted to a) welcome you to PF & b) mention that full source code is included so if you don't get a reply you can always look and see yourself (depending on your skill level the source is reasonably easy to read). I assume it's performance you are concerned with?
Yes clipping is provided for you in PF. You don't need to do anything special to use it, it just works =)
Thx,

Yeah it's performance and I do not want to write to memory that does not belong to me :)

Now that I look at the Rasterizer Blit function, I wonder why I didn't notice this little snippet:
Code:
destRect.Intersect( m_clipper );


Ahh well, it's funny I wrote almost the identical clipping code and only after implenmenting it noticed that PF seems to already be doing it.


Oh and let me say that PF is wonderful. It made a tiled scrolling background at a decent frame rate possible. Thx Thierry, great tool!