Why oh why can not SDL be used instead of DirectX in RTC.
I have said it before and I say it again, with SDL the lucky people using Linux, Mac, Solaris or whatever could be playing RTC without the need of layers of emulation.
What is it that DirectX 3.0 has that SDL lacks? Frame buffer? No. Mouse and keyboard input? No. Sound library? No. Platform independence? Yes!
SDL instead of DirectX
Moderator: George Gilbert
Forum rules
Please read the Forum rules and policies before posting. You may
to help finance the hosting costs of this forum.
Please read the Forum rules and policies before posting. You may

- George Gilbert
- Dungeon Master
- Posts: 3022
- Joined: Mon Sep 25, 2000 11:04 am
- Location: London, England
- Contact:
Well, 99.9% of the reason why it uses DirectX is that I started writing RTC back in about 1998 or so when SDL didn't exist - DirectX was really the only viable option.Why oh why can not SDL be used instead of DirectX in RTC
So the real question you want to ask is why don't I delete all the thousands of lines of tested, working, stable and optimised code of the graphics functions that interface onto the DirectX libraries that I've written and re-write, test, debug and optimise them to call onto the SDL ones...I think that answers itself

On the flip side, it's something I might have considered if starting again from scratch right now - equally if I find myself with a lot of spare time, it's an enhancement that I could make to the current version.
Anyway, I seem to remember that someone got RTC working on Linux or was I imagining that?
- cowsmanaut
- Moo Master
- Posts: 4380
- Joined: Fri Jun 30, 2000 12:53 am
- Location: canada
Well first official version of SDL (0.3) was released in October 1997. Admittedly it barely handled 2d graphics back then.George Gilbert wrote:Well, 99.9% of the reason why it uses DirectX is that I started writing RTC back in about 1998 or so when SDL didn't exist - DirectX was really the only viable option.Why oh why can not SDL be used instead of DirectX in RTC
I know I have made the assumption that DirectX is only used for blitting 2d graphics, reading the keyboard and mouse, and playing sounds. I have also assumed that you have wrapper functions to hide the most of the actual calls toDirectX to ease your own work (The statement "...interface onto..." makes me believe this stronger). If these assumptions are true then my own experience with both DirectDraw (I can not speak for DirectInput and DirectAudio as I have never used them) and SDL says the task is quite small. You might have to remove 1000 lines, but I doubt you will have to add them all again to do the same stuff in SDL instead.George Gilbert wrote:So the real question you want to ask is why don't I delete all the thousands of lines of tested, working, stable and optimised code of the graphics functions that interface onto the DirectX libraries that I've written and re-write, test, debug and optimise them to call onto the SDL ones...I think that answers itself
On the flip side, it's something I might have considered if starting again from scratch right now - equally if I find myself with a lot of spare time, it's an enhancement that I could make to the current version.
And if you did I would be more then happy to give you any help I can.
Others have done it before, a good hobby project example is ianout. Originaly written with DirectX and later changed to SDL. And then we have the commercial games that have used SDL for ports, like Civilization: Call to power and a handful of others.
I have had RTC running on Linux using Wine, it works fine as long as you have a x86 machine. For non x86 machines it runs well under both Virtual PC for Mac and Bochs on quite a few operating systems.[/i]George Gilbert wrote:Anyway, I seem to remember that someone got RTC working on Linux or was I imagining that?