DirectDraw
DirectDraw
DirectDraw
DirectDraw
DirectDraw
DirectDraw DirectDraw DirectDraw DirectDraw DirectDraw DirectDraw DirectDraw DirectDraw
DirectDraw DirectDraw
DirectDraw
Go Back  Xtreme Visual Basic Talk > > > > DirectDraw


Reply
 
Thread Tools Display Modes
  #1  
Old 04-05-2005, 07:09 AM
JonasE JonasE is offline
Newcomer
 
Join Date: Jul 2004
Location: Sweden
Posts: 8
Default DirectDraw


I just switched the rendering mode from BitBlt to DirectDraw for my tile engine, but now it flickers quite badly when the map is scrolled. Can anybody help me please? I'm really new at all this DirectX programming. Also, I tried using a backbuffer... it didn't work... Still flickers... This is the code to create graphics to a picturebox ==>


Private Sub DrawSurface()
Dim Dest As Rectangle
Try
BackSurface.ColorFill(Color.Blue)
BackSurface.DrawFast(0, 0, MapSurface, Map.Rect, DrawFastFlags.Wait)
Catch ex As SurfaceLostException
InitializeSurface()
End Try

Dest = New Rectangle(PointToScreen(Me.picMain.Location), Me.picMain.Size)
FrontSurface.Draw(Dest, BackSurface, DrawFlags.DoNotWait)
End Sub
Reply With Quote
  #2  
Old 04-05-2005, 08:20 AM
Iceplug's Avatar
IceplugDirectDraw Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

Is FrontSurface the surface that draws to the screen? How often are you drawing it?
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #3  
Old 04-06-2005, 08:14 AM
JonasE JonasE is offline
Newcomer
 
Join Date: Jul 2004
Location: Sweden
Posts: 8
Default

Yes, FrontSurface is the surface that draws to the screen (Picturebox, not in fullscreen). Every time i hit arrowkeys.
Reply With Quote
  #4  
Old 04-06-2005, 11:54 AM
Iceplug's Avatar
IceplugDirectDraw Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

Oh... have you ever done a game loop before?
Have a look here:
http://iceplug.vwebservices.com/cnddfrsh.htm
But that is usually what governs how the display is drawn.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #5  
Old 04-07-2005, 07:26 AM
JonasE JonasE is offline
Newcomer
 
Join Date: Jul 2004
Location: Sweden
Posts: 8
Question

I attach a very short and simple version off my program, but the graphics draws in the same way. If you press and hold down “right key”, the rectangle will move to the middle of the picture box, then the background start to scroll. In the same time the background starts to flicker. Test, and see for you self.
Attached Files
File Type: zip Kar.zip (46.3 KB, 22 views)
Reply With Quote
  #6  
Old 04-12-2005, 06:58 AM
JonasE JonasE is offline
Newcomer
 
Join Date: Jul 2004
Location: Sweden
Posts: 8
Default

Any solution?

Iceplug?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
DirectDraw
DirectDraw
DirectDraw DirectDraw
DirectDraw
DirectDraw
DirectDraw DirectDraw DirectDraw DirectDraw DirectDraw DirectDraw DirectDraw
DirectDraw
DirectDraw
 
DirectDraw
DirectDraw
 
-->