Raw input blues

Started by
6 comments, last by ProgrammerZ 15 years, 9 months ago
Hello.... Anyway, I was coding an input module for my engine, and I was trying to add support for raw input. However, the compiler said that the identifier RAWINPUTDEVICE was not defined. After a little poking around, I found the definition of the RAWINPUTDEVICE struct in Winuser.h. I also noticed that there was a section: #if (_WIN32_WINNT >= 0x0501) ... #endif All the raw input stuff was within this #if. However, the text was gray (I'm using Visual C++, by the way), which means the #if failed. Does this mean that I'd have to upgrade my computer to use raw input? Please help! --ProgrammerZ
Advertisement
clicky

As long as you're running Windows XP or higher you should be able to just #define the macro to whatever baseline you're targeting.
So, would I code something like this?

#define _WIN32_WINNT 0x0501

#include <windows.h>
#include <windowsx.h>

Thanks for the advice, by the way.
You'd probably want to toss it in your project settings -- you'd have to #define it before every #include otherwise, including those #includes made by other libraries in headers you're using.

But yes, you've got the idea.
Quote:Original post by MaulingMonkey
You'd probably want to toss it in your project settings

Um, not to sound totally decadent, but how exactly would I do this? (I'm still learning all the ins and outs of Visual C++.)

Right click on your project -> properties -> C++ settings -> Preprocessor settings
(can't remember the exact names, but something like that)

You can make project-wide #defines there
Mmmhmm. Definitions there are seperated by semicolons -- to #define it to a value, you'd use e.g. _WIN32_WINNT=0x0501
Hey, thanks everyone! Project just successfully compiled!

This topic is closed to new replies.

Advertisement