[SDL] Re: DDraw -> SDL how to port ?
ben.campbell at cyberlife.co.uk
Fri Apr 21 09:53:29 PDT 2000
Andreas Hofmeister wrote:
> > Doesn't SDL already use DirectDraw internally under Win32?
> Yes, thats correct but what I want to do is what LokiGames (for example)
> does, too : The 2D Engine is written with DirectDraw an I want to port it to
> SDL, so that the Engine can be used under Linux or BeOS...
I've done a similar sort of thing, and in general found that ddraw maps
pretty well to SDL. So it might not be as hard as it looks. If you
original graphics code is well laid out and easy to understand it should
be reasonably painless.
As a starting point, go through each directdraw call or structure and
look up an SDL equivalent.
For example, ddraw surfaces can be replaced with SDL_Surfaces, replace
ddraw blit functions with SDL ones etc...
Lots of scanning though the ddraw and SDL docs is probably on the cards
Also, there's bound to some other issues to solve if you try to compile
on a non-win32 platform. Compiler differences, API incompatabilities,
filesystem case sensitivity etc etc...
Ben Campbell (Antipodean Straggler)
Programmer, Creature Labs
ben.campbell at creaturelabs.com
More information about the SDL