OpenGL Input

Started by
14 comments, last by Simian Man 15 years, 11 months ago
I noticed when I was about to learn SDL ONLY for input, that it did the pretty much the same thing for input as they did in Video Turorials Rock with OpenGL and GLUT. So will I lose speed if I use OpenGL for input? When I was reading a book I had on DirectX 10, it said Windows Programming ran too slow to have input for our game, which is why we use DirectInput 8. I would rather use OpenGL, with OpenAL for sound, because I can't get SDL to work with VC++ 2008 Express Edition. I haven't tried OpenAL yet, but it installed and worked right. If I do have to use SDL, can I have a tutorial to get SDL to work with with VC++ 2008? [Edited by - Jedimace on May 27, 2008 9:05:39 AM]
-Jedimace1My company siteEmber StudiosAlmost Done
Advertisement
Quote: So will I lose speed if I use OpenGL for input?
No answer. OpenGL is purely a graphics API, so you cannot use it for input.
Quote:I would rather use OpenGL, with OpenAL for sound, because I can't get SDL to work with VC++ 2008 Express Edition.
Then, your focus should be on getting SDL to work.
Quote: If I do have to use SDL, can I have a tutorial to get SDL to work with with VC++ 2008?
Because SDL itself has (what I believe) sufficiently clear instructions on compiling and using it with VC++, it would help if you told us where you were facing difficulty.
If you don't want to spend the time to get SDL working with Visual Studio Express, then why not switch to something like GLUT? It works pretty much the same and it has decent windowing support.

NOTE: SDL and GLUT both use the Win32 calls for input. Neither of these libraries use DirectInput 8. Also, Win32 input is not slow, rather is quite fast.
------------Anything prior to 9am should be illegal.
DirectInput is pretty much (if not yet) deprecated, even Microsoft recommends *not* using DirectInput for Keyboard and Mouse input, suggesting instead that your game simply monitor WM_KEYDOWN/WM_KEYUP messages. In short, your DirectX 10 book is incorrect, according to Microsoft.

So it looks to me like you want OpenGL, OpenAL and a little Windows message processing code to capture input.

certainly though, SDL can be made to work with VC++ 2008 with a little effort.

throw table_exception("(? ???)? ? ???");

GLUT is what I meant. RealMarkP told me what I wanted. Thanks on the DX 10 information, it might just have been trying to make me use DirectInput 8.

"No answer. OpenGL is purely a graphics API, so you cannot use it for input."
I meant GLUT. Sorry

If that is true about GLUT, first, is it still multi-platform, and second, if that's a yes, I should have everything installed now. Thanks everyone.
-Jedimace1My company siteEmber StudiosAlmost Done
Yes, glut is cross-platform. More.
There is not much needed to get SDL working with VC Express. I use SDL with VC 2005 Express all the time. All you need to do is set the global include path for the .lib files.

I *belive* that is under tools/options/projects and solutions/VC directories. From there choose "Library Files" from the drop-down and add the path to your SDL libs there. You may need to do the same for your include header files under "header files" or whatever it's called.

For each project you need to include the relevant SDL libs in your project under Project/Properties/Configuration Properties/Linker/Input. In the field labeled "Additional Dependencies" add the name of the SDL libraries (separated by a space) you need there and that should be it.

One final note and take this as a constructive criticism other than a flame:

If something *should* work and if others have gotten to work and you can't, don't just give up. Figure out what's wrong. You may learn something in the process.

I personally use OpenGL for graphics and SDL for everything else (using SDL for audio isn't that hard for my projects)
But I want 3D sound. Does SDL have that?
-Jedimace1My company siteEmber StudiosAlmost Done
Glut is not really well suited for large scale games. If you want a cross-platform way to initialize a window and catch input, go for either SDL or GLFW.

SDL does not have 3D sound, no. But there is nothing stopping you from using SDL for windowing and input, OpenGL for graphics and OpenAL for sound.
And that's what I was going to do. If I learn SDL, I have to learn other parts of SDL too. That's another thing I want to avoid. And I don't want to have to set the project settings for every project, either. I will check out GLFW. Also, why is GLUT not for big projects? Thanks for the responses.
-Jedimace1My company siteEmber StudiosAlmost Done

This topic is closed to new replies.

Advertisement