StartClipedArea()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Fou-Lu
Enthusiast
Enthusiast
Posts: 201
Joined: Tue Jul 12, 2005 8:30 am
Location: I'm pretty sure this is all a nightmare
Contact:

StartClipedArea()

Post by Fou-Lu »

Sometimes you want to draw sprites just on a small part of the screen.

You could clip all of them one by one, but that wouldn't work for sprites3D.

You could also use UseBuffer() on a sprite with the desired size draw everything there and draw this sprite on the screen, but that would be really slow. My sugestion is:

StartClipedArea(X,Y,Width,Height)

;draw all stuff

StopClipedArea()

~Fou-Lu (aka Lørd Cinneris (actually Elias Sant'Ana))

Image Image
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

I don't think than the second solution you told would be really slow (it would be really fast in fact) but the idea is good, i take good note.
User avatar
Fou-Lu
Enthusiast
Enthusiast
Posts: 201
Joined: Tue Jul 12, 2005 8:30 am
Location: I'm pretty sure this is all a nightmare
Contact:

Post by Fou-Lu »

Alright, replace the "really slow" with "really slower". Indeed, it's fast, but not the same. :)

~Fou-Lu (aka Lørd Cinneris (actually Elias Sant'Ana))

Image Image
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

not really slower, it will only involve an additional blit which is not really overkill.
User avatar
Fou-Lu
Enthusiast
Enthusiast
Posts: 201
Joined: Tue Jul 12, 2005 8:30 am
Location: I'm pretty sure this is all a nightmare
Contact:

Post by Fou-Lu »

OK, replace the "really slower" with "just an insignificant bit slower". :lol:
I just said that because I notice difference in the frame rate of my game when I try that. But it's a very small difference.

Anyway you said you would take note, that's enough to make me happy. :wink:

Thanks.

~Fou-Lu (aka Lørd Cinneris (actually Elias Sant'Ana))

Image Image
Post Reply