Multiple LPDIRECTINPUT8 - is this bad?

Started by
2 comments, last by Evil Steve 15 years, 9 months ago
Hey there, I was wondering if it is bad to DirectInput8Create() multiple LPDIRECTINPUT8's. I've got an InputDevice class with an initializationfunction that's supposed to take care of all DirectInput stuff. Is there a problem with calling DirectInput8Create() everytime the initializationfunction's called (thus everytime a new inputdevice is created), or do I need to build a manager class and put the LPDIRECTINPUT8 interface in there? I know the latter's better design, I'm just wondering whether it can damage you application to create multiple LPDIRECTINPUT8's. Sorry for being a bit vague-ish, but I hope you can help me out. - Stijn
What do I expect? A young man's quest to defeat an evil sorceror while discovering the truth of his origins. A plucky youngster attended by her brutish guardian. A powerful artifact which has been broken into a small number of artifactlets distributed around the world.What do I want? Fewer damn cliches. - Sneftel
Advertisement
I'd advise against it, it's likely to have more of an overhead that way. Also, I hope you're not using DirectInput for keyboard or mouse input...
You'd advise against DirectInput in the first place, hmm? Then what'd be a better option (knowing that 'better' is of course a relative term in the programming business)?

Thank for helping out ;)
What do I expect? A young man's quest to defeat an evil sorceror while discovering the truth of his origins. A plucky youngster attended by her brutish guardian. A powerful artifact which has been broken into a small number of artifactlets distributed around the world.What do I want? Fewer damn cliches. - Sneftel
Quote:Original post by stenny
You'd advise against DirectInput in the first place, hmm? Then what'd be a better option (knowing that 'better' is of course a relative term in the programming business)?

Thank for helping out ;)
For keyboard or mouse input, just use Window messages (WM_KEYUP, MW_KEYDOWN, WM_CHAR, WM_MOUSEMOVE, etc). If you really need high-DPI mouse input, then you should use raw input.

This topic is closed to new replies.

Advertisement