Hi I'd just like to learn how to draw in 2D using masm (GDI?)
Any tutorials or threads that I can be pointed to? Feel free to write one!
Peace love and mungbeans
Mike
Posted on 2002-02-04 02:24:32 by mribbons
Hi,

Look for nice examples+asmsrc and tutors :

http://www.rbthomas.freeserve.co.uk/

:alright:
Posted on 2002-02-04 04:53:02 by CYDONIA
Afternoon, mribbons.

I'd just like to learn how to draw in 2D using masm (GDI?)


Have a look at some of the examples which come with the win32asm package.
"GDIBITS" draws some shapes.
"SHOWDIB" loads/saves/and displays a bitmap.
Iczelions' Tut #4 draws text.

Plus, Eoin created some pretty good GDI tuts. They're nolonger posted, so maybe you could PM him for them.

Cheers,
Scronty
Posted on 2002-02-04 05:02:39 by Scronty
Hi Scronty : )

I must be stupid... what's the win32asm package and where is the tutorial when i click that thread link (i'd already seen this thread)... and yup, i've done ic'z tute 4.

Btw thanks Cydonia... I am going thru Ron's dl's as we speak but they aren't well commented enough for an ASM newbie like me

cheers

BTW GREAT SITE


Afternoon, mribbons.



Have a look at some of the examples which come with the win32asm package.
"GDIBITS" draws some shapes.
"SHOWDIB" loads/saves/and displays a bitmap.
Iczelions' Tut #4 draws text.

Plus, Eoin created some pretty good GDI tuts. They're nolonger posted, so maybe you could PM him for them.

Cheers,
Scronty
Posted on 2002-02-04 05:12:21 by mribbons
Afternoon, mribbons.

heh. I edited out the link, after checking it, and finding that the zip wasn't there anymore.
Eoins' w/site is down, so you can't get them there, either :/ .

I've attached his GDI 3d example (I'll take it down when/if he asks :) )

The win32asm package is the stuff you d/load from http://www.movsd.com/ .

Is it specifically GDI you wish to use? or are you looking at OpenGL or DX as well?

Cheers,
Scronty
Posted on 2002-02-04 05:24:13 by Scronty
Well actually I just wanted to graph some floats

Mike
Posted on 2002-02-04 06:31:38 by mribbons
I moved the thread, it's more of a general question...

if you want to "graph some floats", you're probably best off using GDI.
GDI gives you stuff like points, lines, and all sorts of other helpful
stuff that you'd have to do manually if you use DirectDraw.

Take a look in the PlatformSDK:
Graphics and Multimedia Service / Windows GDI.
There's a lot of good documentation there.
Posted on 2002-02-04 09:01:23 by f0dder
If you mean that you actually want to draw a graph then the LineTo GDI function is the easiest to use.

As for fitting it to the window with floats thats not too hard. You need to know the window Width and Height, so just use GetClientRect or hard code the values.

Then you need to decide on the range you wish to graph to the window, lets say for example -20 to 20 on X and -10 to 10 on Y.

Then heres the method, start with a X coord, eg 5, use whatever function you wish to graph to calculate Y. So now you have the coords of two points on the graph x & y.

Simply subtract the leftmost X coord from the value, x - - 20 = 25
Divide byt he range of X values, ( x - - 20 ) / 40 = 0.625
Multipy by the window width (You'll probably need to use fimul ), ( x - - 20 ) / 40 * wndWidth = ??
And then use fistp to store that vaule as an int ready to pass to any GDI drawing function.

Repeat the procedure for Y coords.
Posted on 2002-02-05 02:55:35 by Eóin