I have converted a Tier 1 project to Tier 2, using
2.0.14b.
My executable seemed to be hanging, but after adding a Message() pop-up I could see that it was indeed running. However, trying to display the values from GetPointerX() and GetPointerY() is not working. I get the WIndows "busy" mouse icon and the values do not change.
This works great in Tier 1, so what is different in C++?
I start with the template project for Visual Studio 2013. The following is the code inside the app::Loop (void):
float mouseX;
float mouseY;
while (agk::GetPointerPressed() == 0)
{
mouseX = agk::GetPointerX();
mouseY = agk::GetPointerY();
agk::SetTextString(1, agk::Str(mouseX));
agk::SetTextString(2, agk::Str(mouseY));
agk::Sync();
agk::Sleep(100);
}
I added the Sleep() function to see if a delay might help. It did not.
Yes, the Text objects have already been defined along with color and position.
This code works in Tier 1 (without the namespace of course). This should display the mouse pointer X and Y coordinates, but the program is unresponsive and only 0.00000 is displayed for each of the values. The executable is stuck in this loop. Pressing the mouse button will not cause an exit as it should. Could there be a problem communicating with the mouse driver??
This is a basic part of the AppGameKit so I do not see why this wouldn't work in Tier 2.
home.wavecable.com/~mindsclay