mouse input
Did you install the DirectX SDK? If the DirectX SDK was installed after the Windows SDK, the DirectX \include directory will come before the Windows SDK \include directory in your PATH. This means that Visual Studio will be build with the version of objidl.h that ships in the DirectX SDK. You must build with the version of objidl.h that ships in the Windows 7 SDK.
Look at your VC++ Directory Settings in VS and see if the Windows SDK include path (C:\Program Files\Microsoft SDKs\Windows\v7.0\Include) is at the top of the list. This will make Visual Studio use the SDK resources first. You should also change the settings for the Executable and Library directories, so that the Windows SDK directories are at the top.
To change the directories, in Visual Studio IDE, go to Tools, Options, Projects and Solutions, VC++ Directories.
Look at your VC++ Directory Settings in VS and see if the Windows SDK include path (C:\Program Files\Microsoft SDKs\Windows\v7.0\Include) is at the top of the list. This will make Visual Studio use the SDK resources first. You should also change the settings for the Executable and Library directories, so that the Windows SDK directories are at the top.
To change the directories, in Visual Studio IDE, go to Tools, Options, Projects and Solutions, VC++ Directories.
well after much work I am now only getting the following error.
ID3DXSprite.obj : error LNK2001: unresolved external symbol _GUID_SysMouse
1>
the #define line of code helped
ID3DXSprite.obj : error LNK2001: unresolved external symbol _GUID_SysMouse
1>
the #define line of code helped
Link with dxguid.lib and dinput8.lib.
The SDK-Docs. At the end of each page describing a function there says what header and lib to use.
The SDK-Docs. At the end of each page describing a function there says what header and lib to use.
You can take a look at something I posted a while back. The Input namespace is implemented using DirectInput. It's a bit of a mess since it does some stuff like key-mapping and abstraction, but you should be able to just look over the "initialize" and "update" functions and the mouse related functions and see how to set it up and read mouse input.
Here's a link to the project:
http://www.gamedev.n...attach_id=10098
Please note that I wrote this a while back and I've learned a lot of important stuff since then, so don't think that this is actually good code. It's not horrible, but it's not designed at a professional level either. It's just an example of the basic underlying procedure. The files you want in the archive are "Bricks/Bricks/ns_Input.h" and "Bricks/Bricks/ns_Input.cpp".
Hope that helps.
Here's a link to the project:
http://www.gamedev.n...attach_id=10098
Please note that I wrote this a while back and I've learned a lot of important stuff since then, so don't think that this is actually good code. It's not horrible, but it's not designed at a professional level either. It's just an example of the basic underlying procedure. The files you want in the archive are "Bricks/Bricks/ns_Input.h" and "Bricks/Bricks/ns_Input.cpp".
Hope that helps.
there is alot of good tutorials out there, let me do some learning then I will proceed to do some further work on my game.thanks for all the help everyone
Phil, with the trouble you have with...well, everything, you really should stick to the simpler API's, and DX9 isn't one of those. SFML is a simple API, and easy to use. Just my opinion.
Nooooooooooooo! Never use DirectInput for keyboard or mouse input. Just use WM_MOUSEMOVE, WM_LBUTTONDOWN and so on.
Using DirectInput will remove pointer ballistics, which will make your mouse pointer feel extremely sluggish. It's also hundreds of lines of code to set up and use, where as window messages are "free". And finally, it's actually slower than using window messages - DirectInput spawns another thread to process raw input messages, meaning it has a higher overhead.
If you're just doing this to learn DirectInput, then go ahead - but never use DirectInput for keyboard or mouse input in a shipping product.
EDIT: From here: http://msdn.microsoft.com/en-us/library/ee418864.aspx:
Summary
Overall, the best method to receive high-definition mouse movement data is WM_INPUT. If your users are just moving a mouse pointer, then consider using WM_MOUSEMOVE to avoid needing to perform pointer ballistics. Both of these window messages will work well even if the mouse isn't a high-definition mouse. By supporting high definition, Windows games can offer more precise control to users.
Using DirectInput will remove pointer ballistics, which will make your mouse pointer feel extremely sluggish. It's also hundreds of lines of code to set up and use, where as window messages are "free". And finally, it's actually slower than using window messages - DirectInput spawns another thread to process raw input messages, meaning it has a higher overhead.
If you're just doing this to learn DirectInput, then go ahead - but never use DirectInput for keyboard or mouse input in a shipping product.
EDIT: From here: http://msdn.microsoft.com/en-us/library/ee418864.aspx:
Summary
Overall, the best method to receive high-definition mouse movement data is WM_INPUT. If your users are just moving a mouse pointer, then consider using WM_MOUSEMOVE to avoid needing to perform pointer ballistics. Both of these window messages will work well even if the mouse isn't a high-definition mouse. By supporting high definition, Windows games can offer more precise control to users.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement