Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » [A5] Should widgets' coordinate properties be 'int' or 'float'?

This thread is locked; no one can reply to it. rss feed Print
[A5] Should widgets' coordinate properties be 'int' or 'float'?
axilmar
Member #1,204
April 2001

Allegro 5 graphics routines take floats as parameters. In GUIs, coordinates are usually expressed as ints.

What is the better approach, in your opinion? should the widgets' coordinate properties (position, size, thickness etc) be specified as floats or ints?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Matthew Leverton
Supreme Loser
January 1999
avatar

I think the bigger question is whether or not you want to support transformations. i.e., Should somebody be able to set up the screen to go from (0,0)-(1,1) and it still work with your GUI?

If the answer is no, then just use integers.

Go to: