Results 1 to 1 of 1

Thread: Direct Draw Clipper

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2000
    Posts
    225

    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
    Last edited by git; Sep 29th, 2001 at 07:25 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width