Is it smart to program a thread for every object or is that doomed to fail?
I would love to create one thread that can hold multiple objects but how would I make them move&die independently?
How do game programmers these days use their threads?
Also I'm having some trouble passing attribute refrences to a thread from another thread.
Creating threads using other threads is that tabu?
DWORD WINAPI MISSILEThread(LPVOID lpParam)
unit missile = *(unit*)lpParam;
int x=missile.x;//<------------SEEMS TO BE LOST IN TRANSLATION NOT SURE WHAT LPPARAM DOES. GIVES THE WRONG VALUE I'VE TESTED IT.
void missile(int x,int y,int direction) //int directions 0=up 1=down 2=left 3=right
missileThread = CreateThread(NULL,0,MISSILEThread,(LPVOID)&missilexy,0,&dwmissileThread_id);
//WaitForSingleObject(missileThread, INFINITE); //only one shot