"Viewport" opposite?

BlitzPlus Forums/BlitzPlus Programming/"Viewport" opposite?

Grisu(Posted 2005) [#1]
Hi!

I was wondering if it is possible to tell blitz that it should "exclude" a set viewport region from drawing?

Instead of drawing only inside the x,y,width,height region I need a function that will only draw stuff "outside/around" it.

Any thoughts?


Grey Alien(Posted 2005) [#2]
I don't think you can. How about copying the viewport to a temp bitmap and then drawing your image and pasting the temp image back over it with DrawBlock (don't need DrawImage as no masking required). This is a brute force approach.


Beaker(Posted 2005) [#3]
That would certainly be the easiest and sane way.


Grisu(Posted 2005) [#4]
I'm using this method already.
The problem you won't gain any speed benefit from this, as you always draw/calculate the whole screen and copy the viewport part backwards.
My idea was only to draw stuff around the viewport as the rest is not needed (hidden).
Seems I have to rewrite my background drawing functions to exclude the viewport part used.

Thanks for your help guys.


WolRon(Posted 2005) [#5]
Seems I have to rewrite my background drawing functions to exclude the viewport part used.
That's how Windows does it.


Grey Alien(Posted 2005) [#6]
wmpaint

Problem is if you are writing your own drawing functions they *may* not be as fast as the blitz ones, so it could actually work out slower.


Grisu(Posted 2005) [#7]
No risk, no fun. :)


Grey Alien(Posted 2005) [#8]
There is also the phrase "reinventing the wheel" ;-).


Grisu(Posted 2005) [#9]
Yepp, but sometimes it feels good make sth on your own.
- Rather than simply copy stuff. ;)


Grey Alien(Posted 2005) [#10]
Yeah I used to make all my own 3D routines and stuff but never got any games finished. It is good to find out how stuff works at core level, but then commericially it makes sense to use someone else's hard work.