Archived

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

Drath

API Independance -> outside graphics

Recommended Posts

I have just about got my Graphical independance running. Okay, so I haven''t implanted any OpenGL support further than instalization or any further than setting matricies, rendering index buffers and texturing in Direct3D, but I feel as if I at least have a usable interface. I now want to try out some new things. Looking at the DirectX API there is DirectInput, DirectPlay, DirectSetup, DirectMusic, DirectSound and DirectShow. I can''t care less about Setup but I am trying to find good alternatives to the other componants, in particular DirectInput currently. What else is there? Thanks.

Share this post


Link to post
Share on other sites
The only real alternative is using the standard Windows API. There''s no real second option as there is with graphics - most input libraries you find will just be wrappers around DirectInput.

Share this post


Link to post
Share on other sites
WHAT? other platforms you say?! Wow, someone else actually taking interest in operating systems other than windows.
Makes me happy.

you want to look at this.
www.libsdl.org

It has been used for Quake2 (and 3?) and UT2003 to make them run on linux. It is a commercial free, highly portable API that can handle your input, sound, and window systems, on just about ALL major operating systems. This is what I use, don''t really even need to know directX ;D it "wraps" it for you so programs run on windows just fine.
if you do get it, make sure you get SDL_Mixer and SDL_Image, these are addon libraries to load more sounds and image types, and there are a ton of other libraries like these on their site..
peace!

Share this post


Link to post
Share on other sites
Yes, other platforms will have their own native API similar to DirectInput or the Windows API.

Anyway my point wasn''t that you can''t have API independence, it''s that for subsystems other than graphics it''s not quite the same. You can use OpenGL instead of DirectX just fine, but what subsititute is there for DirectInput? The Windows API is a poor one at best, I''m not sure if it has real support for joysticks for example.

Share this post


Link to post
Share on other sites
Though this may sound strange, I am more interested in the fact that I''ll be able to program a portable application rather than the fact it will work on alternative systems. The closest I have ever come to platforms other than windows is writing a mail on a mac with os 9 or something.
Anyway, I certainly believe Linux has a place in the future but for now, all I really care about is learning to actually be able to code properly rather than learning some functionality then making a pong or other simple game clone.

PS)
Looking through SDL it seems rather simplistic, though I''m not saying that as a bad thing. I''d rather actually do something. Would something like 3D sound have to be individually implanted? I have not seen anything about that.

Share this post


Link to post
Share on other sites
Dobbs... the Win32 API has excellent, highly reliable support for joysticks... well... if there is only one joystick, and it is plugged into a game port, and it has no more than 8 buttons and 4 axes...

Beyond that, you need DirectInput under Windows. Even just adding a second joystick requires driver-specific fixes to work under the Win32 API solution.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What is the problem with DirectInput?? What are you trying to do that it can''t handle?

Share this post


Link to post
Share on other sites
Only that it is only for windows and I was thinking abstractng each interface would help my skills.

Share this post


Link to post
Share on other sites
Ok you''re confusing two issues here, platform independence and API independence. Which do you want?

Share this post


Link to post
Share on other sites
Eventually both though Platform independance is rather hard to do when you only have a computer with windows loaded. I want as many APIs as possible just so I can test and experiment and build something that can contain them all.

Share this post


Link to post
Share on other sites