Index: trunk/src/sdl/sdl_window.cc
===================================================================
--- trunk/src/sdl/sdl_window.cc	(revision 454)
+++ trunk/src/sdl/sdl_window.cc	(revision 486)
@@ -45,13 +45,38 @@
 	}
 
-	// 	NV_LOG( LOG_INFO, "Joystick count : " << SDL_NumJoysticks() );
-	// 	SDL_Joystick* j = SDL_JoystickOpen(0);
-	// 	if (j)
-	// 	{
-	// 		NV_LOG( LOG_INFO, "Joystick Name: " << SDL_JoystickNameForIndex(0) );
-	// 		NV_LOG( LOG_INFO, "Joystick Number of Axes: " << SDL_JoystickNumAxes(j));
-	// 		NV_LOG( LOG_INFO, "Joystick Number of Buttons: " << SDL_JoystickNumButtons(j));
-	// 		NV_LOG( LOG_INFO, "Joystick Number of Balls: " << SDL_JoystickNumBalls(j));
-	// 	}
+// 	NV_LOG_INFO( "Joystick count : ", SDL_NumJoysticks() );
+// 	SDL_Joystick* j = SDL_JoystickOpen(0);
+// 	if ( j )
+// 	{
+// 		NV_LOG_INFO( "Joystick Name: ", SDL_JoystickNameForIndex( 0 ) );
+// 		NV_LOG_INFO( "Joystick Number of Axes: ", SDL_JoystickNumAxes( j ) );
+// 		NV_LOG_INFO( "Joystick Number of Buttons: ", SDL_JoystickNumButtons( j ) );
+// 		NV_LOG_INFO( "Joystick Number of Balls: ", SDL_JoystickNumBalls( j ) );
+// 	}
+
+ 	NV_LOG_INFO( "Joystick count : ", SDL_NumJoysticks() );
+	SDL_GameController *controller = NULL;
+	int controller_index = 0;
+	for ( int i = 0; i < SDL_NumJoysticks(); ++i )
+	{
+		if ( SDL_IsGameController( i ) )
+		{
+			controller = SDL_GameControllerOpen( i );
+			controller_index = i;
+			if ( controller ) break;
+			NV_LOG_ERROR( "Could not open gamecontroller ", i, ": ", SDL_GetError() );
+		}
+	}
+
+	if ( controller )
+	{
+		SDL_Joystick* j = SDL_GameControllerGetJoystick( controller );
+		NV_LOG_INFO( "Controller Name: ", SDL_GameControllerNameForIndex( controller_index ) );
+		NV_LOG_INFO( "Controller Number of Axes: ", SDL_JoystickNumAxes( j ) );
+		NV_LOG_INFO( "Controller Number of Buttons: ", SDL_JoystickNumButtons( j ) );
+		NV_LOG_INFO( "Controller Number of Balls: ", SDL_JoystickNumBalls( j ) );
+	}
+
+
 
 	void* ctx_handle = SDL_GL_CreateContext( static_cast<SDL_Window*>( m_handle ) );
