C structs

Lutger lutger.blijdestijn at gmail.com
Tue Oct 19 13:53:50 PDT 2010

Mafi wrote:

> Hello,
> I'm trying to write some SDL wrapper. After a long fight against
> objconv, implib and optlink I finally got SDL loading. Hurray! Now I'm
> going to write a wrapper for SDL_Surface. I will only use surface
> poiters so my questions is if I can safely put these pointers into class
> instances which on destruction free the surface (iff it's no display)?

Some caveats apply:

iirc with SDL you typically initialize and close down the different 
subsystems. With the GC finalizing surfaces will be freed after sdl 
shutdown, dunno if that's legal.

Also, sdl surfaces may take lots of space, so if possible I would free them 
when no longer in use. The GC may not collect at all, or late. But this may 
or may not be a problem. 

More information about the Digitalmars-d-learn mailing list