Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / DarkGDK and Nintendo Wii Controller

Author
Message
Da_Donik
17
Years of Service
User Offline
Joined: 9th Dec 2006
Location: Southern Germany
Posted: 19th Mar 2008 19:54
Hi everyone =)

I have found a library (WiiYourself!) which allows you use a Nintendo Wii controller with C++. The library is fairly easy to use. You just need to have Bluetooth and your done =)
The only problem is, that it just doesn't work...(no compiler erros or such stuff, just no connection to the controller)
After hours of searching on forums i discovered the problem.

The Wii controller is handled like a joystick. That means that DarkGDK gets the handle to my Wii controller and the WiiYourself! library has no chance to work. The solution would be to connect to the Wii, before DarkGDK is initializing (and grabing all joystick handles).
Now my question to the C++ gurus out there...is it possible to call a function of a library BEFORE DarkGDK initializes?
If its possible it would be nice to tell me how =)

Greets
Donik
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 19th Mar 2008 23:43
I can see a possible workaround but it's kludgy.

Create a class with an appropriate name. Instantiate an object of that class at the global level. The constructor for the class would either need to be the function you're trying to invoke or call the function. HOWEVER, if the function you're using depends on Dark GDK being initialized or requires that winmain() be run first, then it would probably blow up.

Lilith, Night Butterfly
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 20th Mar 2008 00:02
I think it is your use of the library. Wii controllers do not have any inherent linkage with DirectX at all. It sounds like the library is doing all of the work, including using Sockets to connect to the device.

In DirectX, the joysticks are all installed using Control Panel. If you cannot see the Wii controller there, it does not exist to DirectX, or by extension...to GDK.

If that were the case, you'd be able to enumerate it at least using GDK.

I will D/L the library and check it out, but I think it is not DX that is the trouble, here.
Da_Donik
17
Years of Service
User Offline
Joined: 9th Dec 2006
Location: Southern Germany
Posted: 20th Mar 2008 00:29
Good point Lilith, I will try this tomorrow and give you a feedback. I didn't thought about using a class constructor but that sounds logical to me.

Don't get me wrong Jinzai, I don't want to use the DarkGDK commands to interact with the Wii controller. The WiiYourself!library has all the commands you need to interact with the controller.
I read that someone using 3DGameStudio has discovered that the library doesn't work, because 3DGameStudio had reserved all the joystick handles. Therefore the library wasn't able to connect to the controller.

For everyone who is interested or wonders about the practical use of a Wii controller, here two youtube links (AMAZING!!!!!):
http://www.youtube.com/watch?v=Jd3-eiid-Uw
http://www.youtube.com/watch?v=0awjPUkBXOU&feature=related

and the page of the developer where you can download the library:
http://wiiyourself.gl.tter.org/
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 20th Mar 2008 03:22
Right, and anyway...it doesn't contain the best parts! (The accelerometers).

I was just looking at it...its .NET...managed code. Is that okay in GDK?
Da_Donik
17
Years of Service
User Offline
Joined: 9th Dec 2006
Location: Southern Germany
Posted: 20th Mar 2008 10:00
It works
Lilith, your my hero! I just made a class that contains nothing but the part that connects to the Wii. As Lilith said i used the class constructor therefore. Now everything works as expected

Jinzai, have you tried the Demo program delivered with the WiiYourself! library? There you can see that the accelerometers are actually working
Da_Donik
17
Years of Service
User Offline
Joined: 9th Dec 2006
Location: Southern Germany
Posted: 20th Mar 2008 10:19
Of course i'm using de C++ version of the library.

If anyone trys the library and has problems like i had, i'm willing to help
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 20th Mar 2008 16:18
Quote: "Lilith, your my hero! I just made a class that contains nothing but the part that connects to the Wii. As Lilith said i used the class constructor therefore. Now everything works as expected "


Kewlsome. It's really strange what you can do with this kind of construct. I've seen some classes that encapsulate the main or winmain functions so all you have to do is instantiate an object of the class and the rest takes care of itself. It's not the first thing I would have thought to do but when you see how others use these methods it leads to a new branch of thinking.

Lilith, Night Butterfly
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 20th Mar 2008 16:23
I don't even have a WiiMote, or Bluetooth right now, so...no.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Mar 2008 19:12
Quote: "when you see how others use these methods it leads to a new branch of thinking."


I was thinking a new limb of thinking

Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 24th Mar 2008 19:36
Quote: "I was thinking a new limb of thinking"

But you're the 3D guy. I'm just a 2D projection of a 3D world.

Lilith, Night Butterfly
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA

Login to post a reply

Server time is: 2024-09-29 15:24:48
Your offset time is: 2024-09-29 15:24:48