Jump to content
  • Advertisement
Sign in to follow this  

New here and need a little help

This topic is 4479 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

First off, hello. Second, I'm making a DirectDraw 2D game in Visual Basic and am encountering a weird glitch. I have a 1.2 MB background map which I have loaded onto a surface and can succesfully Blit that to the BackBuffer and flip it. Also my computer has no trouble in moving around the map which is about 6 times larger than my screen. However, my problem comes when I try to zoom out from it. As the image is 6720, 3664 I would like to grant the user the ability to zoom out, but when Zoom <> 1 when I do so there is a massive smearing effect on the displayed picture.
Public Sub DisplaySprite()
'posTop is an integer holding the current position for the top of
 'the rectangle on the background map
'posLeft is an integer holding the current left position
'Zoom is a double indicating level to multiply by
'Map is the Surface holding the background map

Dim SrcRect As RECT
Dim DestRect As RECT
     'Set up the source rectangle
     With SrcRect
         .Bottom = (posTop + 768) * Zoom
         .Left = posLeft
         .Right = (posLeft + 1024) * Zoom
         .Top = posTop
     End With
     'Set up the destination rectangle
     With DestRect
         .Bottom = 768
         .Left = 0
         .Right = 1024
         .Top = 0
     End With
     'Blit the surface on to the backbuffer
     BackBuffer.Blt DestRect, Map, SrcRect, DDBLT_KEYSRC Or DDBLT_WAIT
End Sub
So basically what I'm trying to do is take an area out of the Map Surface that's, for example, (1229, 921) and place it on the BackBuffer at (1024, 768) Any ideas as to why it's smearing it? Thanks for any help, and if you need any more info (more code, screenshots, etc, let me know)

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!