OpenGL And SDL

Hi,
I am trying to figer out how I want to go about this…

I know and want to use OpenGL…

I want the ability for the program to work on all OS…

So SDL was told to me to use…

I like it but I am a little confused…
SDL seems to just use other things like DirectX and simplifies the code… Why would I not just use DirectX?

SDL what is the point behind it? Can I compiler one thing and it just work on all OS?

Thanks,
Andrew

P.S.

I am using OpenGL for rendering
I was going to use SDL for AUDIO and INPUT
And I don’t know what to use for Networking…

Is this right or is there a much better way to go?

Thanks,
Andrew

SDL what is the point behind it? Can I compiler one thing and it just work on all OS?

You can’t just compile the code once and think your exe will work on all platforms. That’s not possible. What SDL does, is allow your source to compile on any platform as long as the platform you are compiling on has the SDL libraries and headers installed. So you can write a program with SDL, compile the code just fine in win32, then copy all your code over to a unix box and compile it just fine for that, etc. So just because the win32 port of SDL may use directx for things like input for example, that doesn’t mean you should just write your code in directx and forget about SDL; reason is stated above.

-SirKnight

AFAIK it is impossible to compile any program in a way, that it runs on more than one OS (except for the different windows OSes ;D ). You ALWAYS have to compile a program for the different OSes, because the bytecode (or however that is called) is completly different.

But with the SDL THAT is possible.

Jan.

Yes I know it is imposable to compile the a exe and have it run on all OS… I am writing a Compiler…

The byte code is much differnt…

I was confused on SDL but it makes since now…

My problem now is this… I have a virtual machine with my compiler so the virtual machine is really all that needs to be compiled on the different OS… IS there a compiler that will run on windows that will compile the C++ into other OS byte code that you know of?

Thanks,
Andrew

IS there a compiler that will run on windows that will compile the C++ into other OS byte code that you know of?

I don’t know of a compiler that compiles C++ into any bytecode. There are compilers that compile C++ into assembly, but that’s different from bytecode.

I just skipped stepts… The C++ to Assembly to byte code to Binary…

Andrew

Originally posted by Jan2000:
AFAIK it is impossible to compile any program in a way, that it runs on more than one OS (except for the different windows OSes ;D ). You ALWAYS have to compile a program for the different OSes, because the bytecode (or however that is called) is completly different.

Well, sometimes that’s not true:
I had a pc running OpenBSD (x86), and it was able to run Linux binaries as well as Solaris ones. So technically, any linux/solaris binary could run on TWO OSes

(Not mentionning third party high-level OS emulators like WINE)

Julien.

Originally posted by ComputerNerd8888:
IS there a compiler that will run on windows that will compile the C++ into other OS byte code that you know of?

Andrew,
This is called cross-compiling.
The GNU Compiler Collection (GCC) allow this. You can get a minimalistic GNU environment with MINGW (which is hosted somewhere at sourceforge.net). There are many web resources on how to setup gcc to cross-compile for another architecture. Try google.

Julien.

I have MINGW…

I did not know it did cross compileing…

Thanks,
Andrew

MingW IS a cross-compiler!

oo I have one used it to compile for windows…

Andrwe

I know gcc can compile for diffrent chips/os’s. gcc is for *nix based systems but it has been ported to cygwin(google it) I havnt played with that but you can try.

I have cygwin and I Use GCC…

Though I still dont know how I would compile for another OS… (I dont know how to set it)…

…But I will google it…

…Thanks,
Andrew