I'm currently developing a game using DarkGDK and the WiiYourself! library so I can use the wiimote on the PC. The problem I'm having is that for some reason, when I use the normal void DarkGDK() entry point for the program, only a single wiimote is recognized. But if I take out void DarkGDK and create my own WinMain function or switch to a console app with void main, I can recognize up to 4 wiimotes. Here's what I mean.
Only recognizes 1 wiimote
void DarkGDK ( void )
{
wiimote* remote1 = new wiimote();
if (remote1->Connect())
MessageBox(0, "remote 1", "", MB_OK);
wiimote* remote2 = new wiimote();
if (remote2->Connect())
MessageBox(0, "remote 2", "", MB_OK);
wiimote* remote3 = new wiimote();
if (remote3->Connect())
MessageBox(0, "remote 3", "", MB_OK);
wiimote* remote4 = new wiimote();
if (remote4->Connect())
MessageBox(0, "remote 4", "", MB_OK);
Exact same setup as previous app, but I add WinMain and now I can recognize all 4 remotes.
//void DarkGDK ( void )
//{
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdParam, int iCmdShow)
{
wiimote* remote1 = new wiimote();
if (remote1->Connect())
MessageBox(0, "remote 1", "", MB_OK);
wiimote* remote2 = new wiimote();
if (remote2->Connect())
MessageBox(0, "remote 2", "", MB_OK);
wiimote* remote3 = new wiimote();
if (remote3->Connect())
MessageBox(0, "remote 3", "", MB_OK);
wiimote* remote4 = new wiimote();
if (remote4->Connect())
MessageBox(0, "remote 4", "", MB_OK);
Everything between the programs stay the same. I'm still including "DarkGDK.h" in both, so all references and library files are still being linked. Does anyone has any insight into what exactly DarkGDK is doing before it calls void DarkGDK()? Or perhaps why in the world my problem is happening?