Basic standard graphics

Adam D. Ruppe destructionator at gmail.com
Fri Nov 12 16:03:51 PST 2010


bearophile wrote:
>  I have not compiled the modified version, so you may test if it works still

Yes, it still works. The FPS on my computer hovers around 155.
The C version is about 180.

If I change it from std.random.uniform to core.stdc.stdlib.rand, it gives equal
results to C.

> Regarding that SDL wrapper [...]

It isn't a wrapper - it is just an interface to the C functions.
Everything is a direct matchup:

C -> D
#include <SDL/SDL.h>  -> import sdl.SDL;

And the function and type names are the same as the C headers.
(I think my SDl import is auto-generated from the C, though
I'm not sure. I downloaded it from the internet years ago.)


A wrapper library should add value rather than just rename things.
Like how my mysql.d file puts mysql_query underneath a

Result query(T...)(string sql, T t);

function that handles escaping from any data type and returns a D style Range of
the results.


But calling raw C MySQL library is a pain in the ass. Raw C style SDL is pretty
simple most the time.


More information about the Digitalmars-d mailing list