1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
Model Tree;
Tree.LoadModelFromWaveFront("StickFigure.obj",D3DXVECTOR4(1,1,1,1),TheGame.m_pDevice);
//load some other models.....
Model arrayModelTrees[7];
for (UINT i(0); i < 7; i++)
arrayModelTrees[i] = Tree1;
// do the same thing with the other models...
for(UINT i(0); i < 7; i++)
vModels.push_back(&arrayModelTrees[i]);
// the same thing with the other models.
//create a timer:
timeGetDevCaps(&tc,sizeof(TIMECAPS));
timeBeginPeriod(tc.wPeriodMin);
TimerID = timeSetEvent(50,tc.wPeriodMin,TimerProc,NULL,TIME_PERIODIC);
// the Message Loop....
while(GetMessage(&msg,0,0,0) && MemoryLeakAlert(90) == false)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
boolTimerProc = false;// the Boolean variable that stops TimerProc from working, if it is set to false, TimerProc stops the timer and returns
return msg.wParam;
}
|