Sign in to follow this  

Encapsulating Direct Input controllers

This topic is 4869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this