Darc Posted December 16, 2003 Posted December 16, 2003 I'm trying to figure out how to get GDI+ to get to higher FPS. Right now it's only going around 8-11 on a good day. I am coding in Visual Basic .NET if that could be the problem for the speed (I only own it and C++ .NET and I have yet to learn Managed C++) This is how I normally do my GDI+ drawing: Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim start, count, curr As Integer start = Environment.TickCount Me.Show() Do curr = Environment.TickCount pbx.Invalidate() Application.DoEvents() If start <= curr - 1000 Then start = Environment.TickCount Console.WriteLine(count) count = 0 Else count += 1 End If Loop End Sub Any tips? Quote
AndreRyan Posted December 29, 2003 Posted December 29, 2003 GDI+ is generally slower because it operates like Direct3D's 2D functions[it does Rotation, AlphaBlending, Scaling, etc] but doesn't use Hardware acceleration, so it is very slow. In Windows Longhorn, GDI+ will hopefully be linked into Avalon(New graphics engine, replacement of GDI, it's based on Direct3D) but until then GDI+ has a low framerate so drawing only when necessary(or at least only the parts that change) will increase your framerate reasonably otherwise use the drawing APIs in GDI32.DLL Quote .Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
ThePentiumGuy Posted December 31, 2003 Posted December 31, 2003 go to form_load and type in SetStyle(controlstyles.doublebuffer,true) Setstyle(controlstyles.allpaintinginWMpaint,true) makes it faster & less flickery Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.