-
Direct Draw Clipper
Hiyas,
I'm creating a game in Direct Draw 7 fullscreen, and I'm trying to create a clipper. Yeah yeah yeah, I already know how to do it normally...
Here's the situation.
I have the source surface, 320x240. The screen size is 640x480. I want to blit the source surface to any size - it could be smaller than the source size, larger than the source size, or even larger than the screen.
If any part isn't visible, it obviously has to be clipped. But how am I supposed to do that when the source/target scales are completely different?
For example. The place I want to blit from is the 320x240 to the following RECT in a 640x480 resolution.
Code:
Source.Left = 0
Source.Right = 320
Source.Top = 0
Source.Bottom = 240
Target.Left = -400
Target.Right = 800
Target.Top = -30
Target.Bottom = 800
After the process has been performed, it would look something like:
Code:
Source.Left = ? 'This variable would be changed. It would be higher than 0.
Source.Right = ? 'This variable would be changed. It would be lower than 320
Source.Top = ? 'This variable would be changed. It would be higher than 0.
Source.Bottom = ? 'This variable would be changed. It would be lower than 240.
Target.Left = 0
Target.Right = 640
Target.Top = 0
Target.Bottom = 480
How would I clip it and keep the same scale?
Thanks for any help.
-Git