[SDL] Predefine types

Mattias Engdegård f91-men at nada.kth.se
Sat Apr 7 09:27:08 PDT 2001


>Today I wondered why SDL re-defines only int types ? Why not float,
>double,char...

char is an integral type, and SDL defines Uint8/Sint8 for your pleasure.

The typedefs are used when integers of very specific sizes are needed, such
as pixels and sound samples. They are used both to provide platform-
independence from the compiler's own types and (equally important) to
convey intent in the code.

SDL uses very little floating-point internally and specific sizes are not
crucial for that code. Remember, always use the basic C types (int, char,
long etc) unless your code depends on a type being of a certain size




More information about the SDL mailing list