PDA

View Full Version : DirectX DirectInput And DirectSound? Required?



ComputerNerd8888
07-11-2003, 09:50 AM
Hi,

Let me first tell you why I am even asking this question. I was going to go with DirectX but I wanted to check out OpenGL first. After looking at the differers in just one program in OpenGL and all most the same thing in DirectX I was going to go with OpenGL. Also OpenGL seems easier to learn, not as picky as Direct (Meaning what version of DirectX you have, ect.), rendering difference, and most of all it works on ALL platforms not like DirectX which Microsoft is stuck up and only makes things for there platforms!

So I stared looking in to. Some people I know are going to learn OpenGL with me we have all found in some place or a another that DirectInput and DirectSound are require to get Input and play Sound in OpenGL programs. This seem to defeat the purpose of using OpenGL because it would require the person to have DirectX on there machine so it would only work on Windows platforms. Not Linux, all mac versions, ect.

So I need to know if this is true to get Input and Sound do you need to have DirectX? or can OpenGL do all this? Please do not tell me how to code this because as I said before I do not know it and need to know if Input and Sound is possible in OpenGL before I try to learn it!

Thanks,
Andrew

Jared@ETC
07-11-2003, 10:29 AM
For sound you have many options, DirectSound is certainly not the only one (or even the best, IMO). Among others there is OpenAL, the audio equivelent of OpenGL.

For input, DirectInput is unfortunately probably the best comprehensive system for Windows computers. Every windowing system usually has its own input system that can work as well, although some are better than others. The GLUT toolkit, which is multi-platform, also includes mouse and keyboard input support...I am sure other libraries exist, but I have only ever used integrated windowing system controls or DirectInput for user interaction.

nexusone
07-11-2003, 10:51 AM
In part the statment that you need Direct X for sound and input is correct, that is on a windows PC.

Now to be cross platform you can uses a library like SDL, FMOD, GLUT, OpenAL. While a windows PC will still need direct X installed you will only need to know the library commands from what ever library you choose to use.
And when you program is compiled on another computer these sound librarys will be translated to that OS, be it linux or Mac.


SDL = handles window creation, video, sound, input. (Windows, Linux, Mac)

GLUT = handles window creation, input, some extra openGL function.(Windows, Linux, Mac)

OpenAL = audio library, (Windows, Linux, Mac)

FMOD = audio library, MP3, MOD, 3D sound effects etc.(Windows, Linux, Mac)

[This message has been edited by nexusone (edited 07-11-2003).]

[This message has been edited by nexusone (edited 07-11-2003).]

ComputerNerd8888
07-11-2003, 11:20 AM
So is SDL, GLUT, FMOD, ect. still OpenGL? So from your though. I need to know what you think is the best for all OS. It needs to be OpenGL and have Audio and input (I think "Library") This is for a game...

SO I need all of it.

My guess is to use OpenAL for audio?

Thanks,
Andrew

ComputerNerd8888
07-11-2003, 11:33 AM
I cant edit my post since I am posting as a quest...

So let me re say what I said.

I am going to be making a game with some other features, that will be coded in C++. it will will be compiled on a Windows platform. But I want it to run on all the OS. Now to my knowledge C++ is a windows thing and can not run on other OS. But that is OK the only thing that will need to be running on the other OS is the game (The OpenGL part) so I am looking for some why to get every thing OpenGL has, Input, and Audio play on every OS.

Please help me with what library's I would need.

Thanks,
Andrew

*Note* Can OpenGL detect what the OS is and than from that use the Library's need for the OS?

nexusone
07-11-2003, 12:17 PM
Let try to answer both your last two post.

First C/C++ standard programming language and is not a windows only thing, unless you program with windows only type librarys MFC, Direct X.
How you have diffrent steps in making a program, the source code is the C/C++ language. Only after the source code has be compiled and a exe file is create will it only run under the OS in which compiled it.
You take the source and compile it under each OS to create a program that will run under that OS.

I think you need to read up on programming, C/C++ language is built up around library's.
Buy using library's functions not in the base C/C++ language can be added. Example is things like 3D graphics, sound are not standard commands, so you use librarys like openGL and SDL to do that type of program.


In my post I just listed library's that are crossplatform and noted what each library does.
Example was SDL which is a crossplatform library for handling windowing functions, sound functions, and input functions.

These library's you use in conjunction with the openGL library. You would not use all of them together.

If you are creating a game, then the SDL library maybe a good choice. www.libsdl.org (http://www.libsdl.org)

How is works, SDL librarys some in diffrent formats. SDL had librarys for windows, linux and Mac.

Once you write your proram, you will need to compile it on each OS using the correct library for creating each OS version of the program.


Originally posted by ComputerNerd8888:
So is SDL, GLUT, FMOD, ect. still OpenGL? So from your though. I need to know what you think is the best for all OS. It needs to be OpenGL and have Audio and input (I think "Library") This is for a game...

SO I need all of it.

My guess is to use OpenAL for audio?

Thanks,
Andrew



[This message has been edited by nexusone (edited 07-11-2003).]

nexusone
07-11-2003, 12:32 PM
A little more about using library's.

Each OS windowing system has it own setup for opening and closing a window. If you do not use a cross platform library to handle your windowing functions, you would need to learn how to program in each OS the windowing functions.

For example the GLUT library has a set up windowing function:

glutInitWindowSize (500, 500);
glutInitWindowPosition (10, 10);
glutCreateWindow (argv[0]);
glutSetWindowTitle("GlutWindow");

By using this library, the above will open a window for me under any OS that has GLUT support. That way I don't need to learn how to open a windows in Microsofts, linux or Mac, I just use the library's functions and keep it cross platform.


SDL works the same way, you just learn the SDL commands for opening a window and the code says the same for all OS system supported by SDL.

ComputerNerd8888
07-11-2003, 12:35 PM
So if I take OpenGL and use Glut library's, and OpenAL library's. I will have all the basic OpenGL functions with Audio and input.

Right?

Thanks,
Andrew

nexusone
07-11-2003, 05:45 PM
Yes that is correct, if you use opengl, glut and OpenAL, you will have those functions.

But as I stated also my want to look at the SDL library. Then all you would need is the openGL and SDL library. Which the SDL will replace both GLUT and openAL. And the SDL is aimed more at game applications.


Originally posted by ComputerNerd8888:
So if I take OpenGL and use Glut library's, and OpenAL library's. I will have all the basic OpenGL functions with Audio and input.

Right?

Thanks,
Andrew

ComputerNerd8888
07-11-2003, 06:16 PM
my app is more than just a game... That is just one part.

THanks,
Andrew