Encapsulating Direct Input controllers

Started by
4 comments, last by Dreddnafious Maelstrom 19 years, 8 months ago
I don't want to put a lot of work into supporting DInput right now, but it would make my demos more professional and realistic to let you have analogue joypads. I've read through the code for setting it up but without trying I wanted to ask for peoples' experience on how easy it is to encapsulate a controller into say a CDirectInputController class with an instance for each controller, like the keyboard, a joypad etc. Would I also need a CDirectInputManager class to set things up most easily? Basically I want to not have to change much apart from adding a few classes and creating an instance to read values from.
Advertisement
lol, kind of an odd post but yeah, easy as caek. especially using buffered input.
"Let Us Now Try Liberty"-- Frederick Bastiat
Thanks, why odd?
well, i've seen some of your work, and i know you are capable of some advanced stuff. just seems like a very self-evident question for a person at your skill level.(i do the same thing occasionally some i'm not knocking you or anything.)
"Let Us Now Try Liberty"-- Frederick Bastiat
Well I'll take that as a complient, sort of! The problem is, with working full time and having a girl-friend (really full time ;)), I don't have the time to just play around and test stuff like I remember being able to. Kind of treating my game like a prototype I want to make showable, so only the most crucial things get done to advance it as fast as possible. So graphics, physics, a terrain, some sort of sound and some sort of input on the programming side. Obviously DInput can be encapsulated just like anything else, but I wanted to make sure it wasn't a complicated sub-system like DAudio appears to be.
Im with you man, i've seen your skills grow over the last couple of years and it just struck me as odd from you.(i've been growing at the same or perhaps a slightly different rate at the same time.)

on the issue of DSound. as some unsolicited advice. code your own objects, dont use the provided ones.(in the samples that is), most of the work is the initialization code and thats a simple cut and paste. however, the interface provided in the samples is sub-par if all you need is the common functionality. their base objects support EVERYTHING DSound can do, and that's alot to crunch in one sitting.

just make a singleton manager for the main object and an extensible
buffer class that supports streaming if you need it and you'll be good. the 3d sound stuff is actually not tough once you abstract the DSound interface.

from my perspective it seems like you have a bit more discipline regarding coding than i do. some of your posts are tackling some advanced stuff i haven't tried yet, but i have a pretty solid understanding of the whole DX library, becuase when i get bored or stuck i'll often switch from say D3D to DPlay or DSound as a change of pace. As a result i have a pretty complete engine from a fundamental standpoint, but lack a lot of the 2nd tier and 3rd tier features of a complete engine.


anyway, best of luck to you.
"Let Us Now Try Liberty"-- Frederick Bastiat

This topic is closed to new replies.

Advertisement