Jump to content
Xtreme .Net Talk

Irrinity

Members
  • Posts

    2
  • Joined

  • Last visited

Personal Information

  • Occupation
    Programmer
  • Visual Studio .NET Version
    Professional
  • .NET Preferred Language
    VB.NET

Irrinity's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. jen, btoth: Thanks for your reply. Sadly enough your solution didn't do the job :(. Remember, I'm coding a FULLscreen app. I think the problem is that I'm drawing SomeSurface outside of the BackBuffer's surface bounds. I did find a solution myself and works by clipping the source rectangle and the destination rectangle to the edges of the BackBuffer surface: Dim Dst as New Rectangle(0, 0, 32, 32) Dim Src as Rectangle Dim C as New Rectangle(10, 10, 100, 100) 'Clip rectangle If Dst.X < C.X Then Src.X += C.X - Dst.X If Dst.Y < C.Y Then Src.Y += C.Y - Dst.Y Dst.Intersect(C) Src.Width = Dst.Width Src.Height = Dst.Height 'Only draw if SomeSurface is visable If Dst.Width > 0 AndAlso Dst.Height > 0 Then BackBuffer.Draw(Dst, SomeSurface, Src, DrawFlags.DoNotWait) End If This works really well :D . By clipping like this, I still have the option to use DrawFast ;) .
  2. Hi guys, I'm coding this fullscreen managed DirectDraw app. I use the standard flipping principle with a front and a back buffer. Now I want to draw some surfaces onto the back buffer, but clip them off the edges of the back buffer. This doesn't seem to work and gets me an UnsupportedException from DirectDraw. The next example works fine: BackBuffer.Clipper = New Clipper() BackBuffer.Clipper.ClipList = New Rectangle() {New Rectangle(10, 10, 100, 100)} BackBuffer.Draw(New Rectangle(1, 1, 32, 32), SomeSurface, DrawFlags.DoNotWait) In the above example SomeSurface gets clipped the way its supposed to be. Here comes the problem code: BackBuffer.Clipper = New Clipper() BackBuffer.Clipper.ClipList = New Rectangle() {New Rectangle(10, 10, 100, 100)} BackBuffer.Draw(New Rectangle(0, 0, 32, 32), SomeSurface, DrawFlags.DoNotWait) This gets me the UnsupportedException from DirectDraw. The only difference to both pieces of code is in the X and Y values of the drawn Surface. I just dont get it :confused: . Im sure you guys can help me out :). Thanks in advance.
×
×
  • Create New...