News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Drawing to screen

Started by Hjortur, January 15, 2006, 04:50:38 PM

Previous topic - Next topic

Hjortur

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 

daydreamer

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


Tedd

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
No snowflake in an avalanche feels responsible.