Archived

This topic is now archived and is closed to further replies.

Nickels

ok to use opengl graphics and directx input/sound ?

Recommended Posts

Of course, like everybody else, i''ve got this great idea for a program (not quite a game, but could be)! I would like to use Opengl for the graphics and use directx8 or later for the sound and input. is there anything wrong with this? i would like this program to be as widely compatible as possible with good performance.

Share this post


Link to post
Share on other sites
Its fine but if you want to keep portablity you could use FMod for sound, not sure about input. A few openGL libaries has input support but not very good.

Share this post


Link to post
Share on other sites
YES. I use GL for graphics and DX for input and sound. If you want to make it portable use SDL

[ My Site ]
''I wish life was not so short,'' he thought. ''Languages take such a time, and so do all the things one wants to know about.'' - J.R.R Tolkien
/*ilici*/

Share this post


Link to post
Share on other sites
That''s actually a very common combination.

Although you are shooting yourself in the foot by using DX8 for sound and input with OpenGL. You should use DX7 for those. DInput and DSound have changed very little.

Basically the problem with an OpenGL/DX8 combo boils down to this: OpenGL is compatible with pretty much everything. Even "ancient" hardware. Whereas DX8 is compatible with only the newer stuff (~GeForce 2 and newer). It doesn''t matter if you''re not doing anything with DX8 for things that you could do with DX7, it''s just the fact you using DX8 that breaks your product.

DSound8 is incompatible with older soundcards. DInput hasn''t changed in a very long time. So it really makes no sense to limit your audience just because 8 is a bigger number.

For my latest project I use an OpenGL/DX7 combo which works on pretty much everything.

So you need to ask yourself "am I using features of DSound and/or DInput 8 that aren''t available in DX7?" If the answer is "no," then use DX7 for sound and input.

Ben


[ IcarusIndie.com | recycledrussianbrides.com | Got Linux? ]


Will Post For Food

Share this post


Link to post
Share on other sites
I'd suggest—as someone else did—using FMOD for sound. It's tons easier to use than DirectSound. Of course, it's unfair to compare the two because FMOD is a high-level library. But it's great. In fact, it's hands-down the easiest and most pleasant sound library I've ever used.

For input... if you need joystick support, then you might consider SDL, but otherwise, I'd just use the Windows API. For instance, GetCursorPos, SetCursorPos, and GetAsyncKeyState should be enough for most input needs, and perform adequately well.

[edited by - merlin9x9 on October 7, 2003 9:50:21 PM]

Share this post


Link to post
Share on other sites
FMOD isn''t free for all uses. DirectSound is free for all uses. And getting it to work with Ogg Vorbis is easy. Thereby eliminating all hope of anyone getting a licensing fee out of you. Especially when you use the plug and play class available at the DevZone at IcarusIndie.com for free.

If you want to expand your user base by 3, then using SDL, etc to make it cross platform may be of value. Unless you were intending to make this game project in an effort to learn how to program.

Ben


[ IcarusIndie.com | recycledrussianbrides.com | Got Linux? ]


Will Post For Food

Share this post


Link to post
Share on other sites
Or you could use OpenAL for sound. It''s got an interface that''s quite similar in syntax to OpenGL, which is nice for consistency. Under Windows, it actually uses DirectSound internally, but it is cross platform compatible. And it gives you hardware 3D audio acceleration, which SDL alone won''t give you.

j

Share this post


Link to post
Share on other sites
quote:
FMOD isn''t free for all uses.

That''s true. If I recall correctly, it''s free for non-commercial use; that''s probably just fine for most of us around here.

DirectSound may be free, but it''s very low level, and—I think—a pain in the neck to use.

Share this post


Link to post
Share on other sites
Didn''t DX8 do some crazy sound merger stuff too, not just the gfx?

I never paid very close attention to it, but I thought DSound vanished and became DMusic or something like that...?

Share this post


Link to post
Share on other sites
quote:
Original post by Nickels
Of course, like everybody else, i''ve got this great idea for a program (not quite a game, but could be)!

I would like to use Opengl for the graphics and use directx8 or later for the sound and input.

is there anything wrong with this?


Yes, you''ll be damned for all eternity for trying to mix Microsoft stuff with, err, Microsoft implemented stuff. In addition, Lunix people will hate you for using DirectX.

Share this post


Link to post
Share on other sites
quote:
Original post by Promit
I never paid very close attention to it, but I thought DSound vanished and became DMusic or something like that...?


Nope. DirectMusic can now be used to play sounds, but it is just a higher level thingy with a whole lot of extra stuff for music processing on top of DirectSound. You can tell DirectMusic to use a DirectSound object you''ve already created to play its sounds through, but you don''t have to.

Share this post


Link to post
Share on other sites
quote:
Original post by merlin9x9
DirectSound may be free, but it''s very low level, and—I think—a pain in the neck to use.


It''s only a pain in the neck to use if you expect it to load your sounds for you, which it doesn''t. However we''re all reasonably able programmers here, so just loading a file shouldn''t be a problem for us. At a low priority level it does all the mixing etc. for you, but if you want you can take it over. Of course, if you''re one of those chaps who''s opposed to COM on principle then it may not be for you either.

Share this post


Link to post
Share on other sites
I agree that OpenAL is a good choice. OpenAL is to sound what OpenGL is too graphics(both openSource api''s and cross-platform compatible). Rather use OpenAL with OpenGL than mixing it with DirectX.

Share this post


Link to post
Share on other sites