On Monday, 23 July 2018 at 10:33:28 UTC, Mike Franklin wrote:
On Monday, 23 July 2018 at 09:52:54 UTC, Zheng (Vic) Luo wrote:
Regarding floating point operations, I plan to use
dmd.builtins/ldc.builtins instead of linking with libm.
That reminds me. Something else to consider is that some of
these microcontrollers don't have FPUs. Graphics libraries
designed for microcontrollers often use fixed-point math as a
lowest common denominator. I think, given the features of D,
fixed-point or floating point could be selected at compile-time.
But, I don't wish to expand the scope of the project. An
all-floating point library would be fine, IMO, and fixed-poing
math could be added to the library in a future iteration.
Mike
Having already implemented a video game engine using exclusively
fixed point math for a nintendo handheld, I can tell you that the
rasterizer code will have to be implemented with that in mind.
Using several precisions (16.16/20.12/40.24 formats) and 64 bits
products, avoid divisions, etc.
A very different beast IMHO, even with fixed point structs
overloading the different math operators...