Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Slimdx Xinput - Exception Error - A short Code Provided


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Lightbots   Members   -  Reputation: 100

Like
0Likes
Like

Posted 28 January 2012 - 02:33 PM

Hello,

I don't have an error any more but now its not writing the value from the gamepad and just closing the console right away after outputting 0, am I missing something?

It goes into the connected statement.


using System;
using SlimDX;
using SlimDX.XInput;

namespace ConsoleTest
{
	class Program
	{
		static void Main(string[] args)
		{
			UserIndex u = new UserIndex();
			Controller c= new Controller(u);

			if (c.IsConnected)
			{
				Console.WriteLine(c.GetState().Gamepad.LeftThumbX);
			}
			else
			{
				Console.WriteLine("Not Connected");
			}
		}
	}
}


Sponsor:

#2 Josh Petrie   Moderators   -  Reputation: 3827

Like
1Likes
Like

Posted 29 January 2012 - 11:13 PM

None of those calls block, and there is no loop keeping the program alive. It's doing exactly what you wrote: determines if the controller is connected, prints one line, and exits immediately.

Josh Petrie | Game Developer, Undead Labs





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS