Archived

This topic is now archived and is closed to further replies.

DirectX Clipping/Blitting Problems - Making progress

This topic is 5701 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

Ok, after long searching, I finally found the bugged code in my program, but I cant seem to figure out why it wont work. The bugged code is in my initializing of the clippers, aparently. I initilize surfaces and stuff, and then the clippers in this section of code: ''Create Clipper Dim lpddclipper As DirectDrawClipper Set lpddclipper = lpdd.CreateClipper(0) ''Set Clipper To Window Call lpddclipper.SetHWnd(hwnd) ''Set Current Clipper If Not windowedmode Then Call lpddsback.SetClipper(lpddclipper) Else Call lpddsprimary.SetClipper(lpddclipper) End If This code works fine, so far. The problem is, that the way it clips, is if an image gets part of it clipped, it just doesnt display it. So the edges are really poor looking. The code I added just after it to fix this problem and make scrolling smooth is: Dim r(0) As RECT r(0) = NewRECT(0, 0, ddsdprimary.lWidth,ddsdprimary.lHeight) Set lpddclipper = lpdd.CreateClipper(0) Call lpddclipper.SetClipList(1, r()) Call lpddsback.SetClipper(lpddclipper) Call lpddsbuffer.SetClipper(lpddclipper) The newrect function is just one that simplifies setting up a rect. Anyways, this is the section of code that gives me screwed up graphics whenever it clips an image at the top left corner. Can anyone see what Im doing wrong?

Share this post


Link to post
Share on other sites