The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Hjortur on January 15, 2006, 04:50:38 PM

Title: Drawing to screen
Post by: Hjortur on January 15, 2006, 04:50:38 PM
Hello, I have only been using assembly for 2 months.  And mainly the gas compiler since I was using linux, but now I use masm32.
Anyway, I am working on Bresenhams line and circle routines, and I was wondering how I could draw the pixels to the screen.
I have no problem converting the algorithm itself to assembly, just should I use   setpixel()? 
What I hear is that setpixel is not so fast, and I want to know if there are faster api-s I should be using instead?
Or mabey write my own putpixel function?

Hjortur 
Title: Re: Drawing to screen
Post by: daydreamer on January 15, 2006, 05:48:43 PM
Quote from: Hjortur on January 15, 2006, 04:50:38 PM
Hello, I have only been using assembly for 2 months.  And mainly the gas compiler since I was using linux, but now I use masm32.
Anyway, I am working on Bresenhams line and circle routines, and I was wondering how I could draw the pixels to the screen.
I have no problem converting the algorithm itself to assembly, just should I use   setpixel()? 
What I hear is that setpixel is not so fast, and I want to know if there are faster api-s I should be using instead?
Or mabey write my own putpixel function?

Hjortur 
go search for ddraw include files, there is a ddraw plasma demo somewhere if you search
or you create a GDI bitmap in memory pixel by pixel and bitblt it to screen

Title: Re: Drawing to screen
Post by: Tedd on January 16, 2006, 01:30:24 PM
Use SetPixel for now - while you're still learning; it will be fast enough to test the algorithm.
Once you learn a bit more you can create a bitmap in memory and draw on that (which is as easy as writing the pixels in memory) and then draw the whole bitmap at once - which is much faster :wink