Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411433 Posts in 69363 Topics- by 58417 Members - Latest Member: gigig987

April 20, 2024, 05:57:29 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallForum IssuesArchived subforums (read only)TutorialsDetecting USB Devices, like a gamepad (win32)
Pages: [1]
Print
Author Topic: Detecting USB Devices, like a gamepad (win32)  (Read 4405 times)
h0bbE
Level 0
**



View Profile WWW
« on: October 21, 2008, 12:52:25 PM »

Working on our shoot em up pc game I've struggled a bit with support for game pads.

The trickiest part was knowing if a pad had been inserted or removed while the game was running. I spent a good few hour looking for information so when I finally got it working I wrote a short tutorial, so if you plan on adding game pad support to your windows games you can get some info in my game development blog.

Detecting if a game pad is plugged in or removed

Feel free to use and abuse as you like. A comment or digg is appreciated

Cheers!

/h0bbE
« Last Edit: April 04, 2009, 04:58:19 AM by h0bbE » Logged

zamp
Level 1
*



View Profile
« Reply #1 on: October 21, 2008, 03:37:52 PM »

Pretty nice tute.
You might want to add the window handle declaration or explain what m_hWnd is.
Quote
...
hDevNotify = RegisterDeviceNotification(m_hWnd, &notificationFilter,
...
Logged
h0bbE
Level 0
**



View Profile WWW
« Reply #2 on: October 22, 2008, 03:28:30 AM »

Ah, good point! Fixed, thanx!

/hObbE
Logged

zamp
Level 1
*



View Profile
« Reply #3 on: October 26, 2008, 04:26:19 PM »

Youre welcome, glad to be of help Smiley
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic