Page 1 of 1
SDL instead of DirectX
Posted: Wed Oct 20, 2004 2:30 pm
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!
Posted: Wed Oct 20, 2004 3:25 pm
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
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?
Posted: Wed Oct 20, 2004 6:48 pm
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?
Posted: Wed Oct 20, 2004 7:15 pm
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.
Posted: Wed Oct 20, 2004 11:56 pm
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
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]