PocketMatrix forums

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

BltFast and Clipping

If I am blitting two surfaces of equal size but specify the destX and destY parameters in BltFast greater than zero. Then will BltFast would do the clipping itself or it will throw an error.

I am assuming that SetClipper(null) has not been called.

Also wanted to clarify if we try draw outside a surface without enabling clipping then do the drawing functions like DrawLine or DrawRect will give error?
Sachin · 04 Mar 2004, 10:36 UTC — BltFast and Clipping
Also wanted to know can destX and destY be negative values
If I am blitting two surfaces of equal size but specify the destX and destY parameters in BltFast greater than zero. Then will BltFast would do the clipping itself or it will throw an error. I am assuming that SetClipper(null) has not been called.


If you have not set a clipper, BltFast will return the "invalid rectangle" error code.

Also wanted to clarify if we try draw outside a surface without enabling clipping then do the drawing functions like DrawLine or DrawRect will give error?


Yes.

Also wanted to know can destX and destY be negative values


Yes. :)
Johan
These things are not clear in GapiDraw's documentation. So please also add these things to the documantation if you feel they are relevant.

Thanks
One more question

If after enabling clipping for the entire surface by calling SetClipping(null).
If I resize the surface by calling CreateSurface then do I have to enabling clipping again?
If after enabling clipping for the entire surface by calling SetClipping(null).
If I resize the surface by calling CreateSurface then do I have to enabling clipping again?


Yes, the clipper is erased if you re-create the surface.
These things are not clear in GapiDraw's documentation. So please also add these things to the documantation if you feel they are relevant.


Done!
Johan wrote:
If after enabling clipping for the entire surface by calling SetClipping(null).
If I resize the surface by calling CreateSurface then do I have to enabling clipping again?


Yes, the clipper is erased if you re-create the surface.


Johan, in addition to Sachin's questions, do I have to call SetClipper once only in my game? I put mine in ProcessNextFrame. Lol. :)
You only need to call it once per surface when it is created. If you need to recreate the surface from a minimize event, you'll need to recreate the clipper as well.
In regards to clipping...

If I have a bunch of objects, should I go ahead and blit them even if they are offscreen, or test for an offscreen condition beforehand? Is allowing the clipper to do all the testing and such just as efficient?
The clipper simply checks the bounds of the surface you're blitting to, so it should be just as efficient as testing it yourself.