When I was using a class to wrap SDL functions and structs, I would have a
problem that Derelict would unload before the garbage-collector cleaned up my
classes, resulting in errors when these classes destructed and tried to call
SDL functions in the process. However, the exact same code using structs to
wrap instead of classes does not produce these errors. For example, rather
than using
scope screen = new Screen(800, 600)
where Screen is a scope class, I'm using
auto screen = new Screen(800, 600)
where Screen is a struct. This also provides me the advantage of being able to
use delegates which use screen. Is there a reason for this?

Reply via email to