Re: Hints on Drawing in TASM
From: The Half A Wannabe (shit)Zulu_at_hotmail.com)
Date: 12/17/03
- Next message: The Half A Wannabe: "OT : Have mercy on me, Have mercy on many men, many many many men"
- Previous message: R.Wieser: "Re: Hints on Drawing in TASM"
- In reply to: xteven: "Hints on Drawing in TASM"
- Next in thread: Rally: "Re: Hints on Drawing in TASM"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 17 Dec 2003 13:52:47 +0100
"xteven" <stevedool@yahoo.com> wrote in message
news:7VODb.2022$Ts5.1237@newsread2.news.atl.earthlink.net...
> Anyone have any good tips on how to start drawing lines in assembly. I
> want to make boxes around numbers...
>
> -xteven
I guess you are asking about dos ? or something non windows ? Ask someone
else.
For Windows/Dos , from memory :
For a most "easy" to do approach (Windows) : GDI
ADC := GetDC( WindowHandleOfWindowToDrawIn);
DrawPolyline( ADC , array of TPoints );
ReleaseDC( WindowHandleOfWindowToDrawIn, ADC);
see http://betov.free.fr/RosAsm.html for how to make that just as easy todo
in ANY assembler.
For more control :
Get Michael Abrashs book Graphics programming black book or something. I
read (long time ago) Zen of Graphics programming. But I would suspect, they
are allmost identical. Maybe a few things added.
Theres a few chapters there on speedy line drawing. He takes us from HHL
line drawing into asm, and then progressivly goes into "nut territory" by
drawing lines that are fast. 500 000 pixels/s on a 386 vga if I recall
correctly. It may pay off not to read only the new stuff. reading old stuff
may pay off in the long run.
For windows: Use DirectX backbuffer or a GDI BitmapSection to draw in. Then
blit it to the screen.
You can of course use MAbrash code to draw directly to the screen memory
buffer. (DirectX) but for GDI you must go via a BitmapSection and then blit
the result. (Irritating, maybe direct GDI is possible, but have not found it
to work yet, but at least you can save the pointers to the BitmapSection
memory, and use them again, as in clearing just whats needed from frame to
frame etc) GDI blitting is not extremly slow on modern hardware. I can blit
a few 1000 (FULLSCREEN) bitmaps/s on my Geforce2 if that is all that I do.
If they are small I can blit about 10000/frame at upto 20-30 frames/sec
At least it could get you started. Also DirectX tutorials all over the place
will help. Today some people use Hardware line drawing, by using 3D hardware
to draw a 3D vector. But a 3D vector is a 2D line onscreen, if the
viewfrustum and matrixes are properly ajusted, one can use 3D hardware to do
2D graphics, with the speed of hardware.
For info on how to get access to Windows API from assembly, read Betovs
short and to the point tutorials < http://betov.free.fr/RosAsm.html >
But in prinsiple its very easy :
push all parameters, and then call api function.
- Next message: The Half A Wannabe: "OT : Have mercy on me, Have mercy on many men, many many many men"
- Previous message: R.Wieser: "Re: Hints on Drawing in TASM"
- In reply to: xteven: "Hints on Drawing in TASM"
- Next in thread: Rally: "Re: Hints on Drawing in TASM"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|