|
|
| [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
|
Mouse coordinates in A5 are still integers, so I say go with integers. Then you don't have to waste time with a bunch of casts in hit tests. The drawing routines take floats though, so you would still have to cast/adjust those. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|
Matthew Leverton
Supreme Loser
January 1999
|
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. |
|
|