The attached is from a project i'm working on using the D2D DemoApp from the MSDN website. I'm trying to create a moving object where the object is instantiated from it's own class (a car, a monster, whatever) The problem seems to be entirely in the app class at the moment though. Attached is just the results from the log file the program is generating and the two calls where the variables are used.
Log - first from the constructor, then from the render()
from constructor ...
200 by 200
300 by 300
from render ...
-858993460 by -858993460
-858993460 by -858993460
In the constructor I call this. The variables named are all public as I was trying to focus on getting the program to render a moving object and didn’t want to create a bunch of getters and setters.
1 2 3 4 5 6 7 8 9
int pos[4] = { 300, 300, 300, 300};
int xposM = 200;
int yposM = 200;
log2.open("logfile2.txt", ios::app);
log2 << "from constructor ..." << endl;
log2 << xposM << " by " << yposM << endl;
log2 << pos[0] << " by " << pos[1] << endl;
log2.close();