beegee Posted June 5, 2007 Author Share Posted June 5, 2007 Hello, I have a question related to the circle drawing method of PDN3. ( brush ) I developed at my own a bitmap class, which can draw faster than getpixel, setpixel of .NET. But when I draw onto the bitmap in my level editor with the circle tool it's too slow. How does this thing works in PDN3. I played around with it, and it's much faster than mine. FillEllipse(20,20); // .NET -- 270-280 ticks DrawCircle(20,20); // My method -- 190-210 ticks How is it done in PDN3? Has it better drawing times or is there a trick? And would someone take the time to post the specific code snippet here? Much thanks. Quote game design rocks... Link to comment Share on other sites More sharing options...
beegee Posted June 5, 2007 Share Posted June 5, 2007 Hello, I have a question related to the circle drawing method of PDN3. ( brush ) I developed at my own a bitmap class, which can draw faster than getpixel, setpixel of .NET. But when I draw onto the bitmap in my level editor with the circle tool it's too slow. How does this thing works in PDN3. I played around with it, and it's much faster than mine. FillEllipse(20,20); // .NET -- 270-280 ticks DrawCircle(20,20); // My method -- 190-210 ticks How is it done in PDN3? Has it better drawing times or is there a trick? And would someone take the time to post the specific code snippet here? Much thanks. Quote game design rocks... Link to comment Share on other sites More sharing options...
pyrochild Posted June 5, 2007 Share Posted June 5, 2007 the System.Drawing.Graphics class has functions called DrawEllipse() and FillEllipse(), which are, of course, far faster than setting one pixel at a time. Plus the Graphics class has extremely easy to use anti-aliasing..... Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
pyrochild Posted June 5, 2007 Share Posted June 5, 2007 the System.Drawing.Graphics class has functions called DrawEllipse() and FillEllipse(), which are, of course, far faster than setting one pixel at a time. Plus the Graphics class has extremely easy to use anti-aliasing..... Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
BoltBait Posted June 5, 2007 Share Posted June 5, 2007 I haven't looked in the code to answer your question, but in my expirence, the best way to draw standard shapes is to use GDI+. You can see how to do it in my source code here: http://paintdotnet.12.forumer.com/viewtopic.php?t=2580 (Ignore the source code listing in that post. Instead, download the VS2005 project zip file listed under the "Source Code" section.) The nice thing about using GDI+ is the fact that you can draw anti-aliased shapes, fast. Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
BoltBait Posted June 5, 2007 Share Posted June 5, 2007 I haven't looked in the code to answer your question, but in my expirence, the best way to draw standard shapes is to use GDI+. You can see how to do it in my source code here: http://paintdotnet.12.forumer.com/viewtopic.php?t=2580 (Ignore the source code listing in that post. Instead, download the VS2005 project zip file listed under the "Source Code" section.) The nice thing about using GDI+ is the fact that you can draw anti-aliased shapes, fast. Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
beegee Posted June 7, 2007 Author Share Posted June 7, 2007 I've developed my own bitmap class, because then I have much more possibilites related to the perfomance. My other reason is, that I need this later for XNA purposes and so it's much more easier to port this class. I just found some bottlenecks in my code, the invalidate, lock/unlock bits thing and the circle calculation. I'll post later the results, when I'm finished. Quote game design rocks... Link to comment Share on other sites More sharing options...
beegee Posted June 7, 2007 Author Share Posted June 7, 2007 I've developed my own bitmap class, because then I have much more possibilites related to the perfomance. My other reason is, that I need this later for XNA purposes and so it's much more easier to port this class. I just found some bottlenecks in my code, the invalidate, lock/unlock bits thing and the circle calculation. I'll post later the results, when I'm finished. Quote game design rocks... Link to comment Share on other sites More sharing options...
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.