SDL instead of DirectX

General messages about RTC and it's development.

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
Post Reply
PeyloW_

SDL instead of DirectX

Post by PeyloW_ »

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!
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Why oh why can not SDL be used instead of DirectX in RTC
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.

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 :roll:

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?
User avatar
Gambit37
Should eat more pies
Posts: 13773
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

1998? The other day I was feeling old, now I know why -- I *am* old! I can't believe it's been six years, seems like only yesterday.... having said that though, I don't recall anything of RTC/NewDM before 2000 -- had you been working on for two years prior?
User avatar
cowsmanaut
Moo Master
Posts: 4380
Joined: Fri Jun 30, 2000 12:53 am
Location: canada

Post by cowsmanaut »

NewDM was a from scratch for DM3 when we were doing that thing still.. From what I remember the first one I saw of RTC was already the first level and a bit more was done but the main engine itself was already built before NewDM was.. so I think the two years prior would be accurate.
PeyloW_

Post by PeyloW_ »

George Gilbert wrote:
Why oh why can not SDL be used instead of DirectX in RTC
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.
Well first official version of SDL (0.3) was released in October 1997. Admittedly it barely handled 2d graphics back then.
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 :roll:

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.
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.

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.
George Gilbert wrote:Anyway, I seem to remember that someone got RTC working on Linux or was I imagining that?
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]
Post Reply