HOG2
|
Go to the source code of this file.
Functions | |
void | MyWindowHandler (unsigned long windowID, tWindowEventType eType) |
void | MyFrameHandler (unsigned long windowID, unsigned int viewport, void *data) |
void | MyDisplayHandler (unsigned long windowID, tKeyboardModifier, char key) |
void | MyPathfindingKeyHandler (unsigned long windowID, tKeyboardModifier, char key) |
void | MyRandomUnitKeyHandler (unsigned long windowID, tKeyboardModifier, char key) |
int | MyCLHandler (char *argument[], int maxNumArgs) |
bool | MyClickHandler (unsigned long windowID, int x, int y, point3d loc, tButtonType, tMouseEventType) |
void | InstallHandlers () |
Allows you to install any keyboard handlers needed for program interaction. More... | |
void InstallHandlers | ( | ) |
Allows you to install any keyboard handlers needed for program interaction.
Definition at line 85 of file Sample.cpp.
References InstallCommandLineHandler(), InstallKeyboardHandler(), InstallMouseClickHandler(), InstallWindowHandler(), kAnyModifier, kControlDown, kNoModifier, kShiftDown, MyCLHandler(), MyClickHandler(), MyDisplayHandler(), MyPathfindingKeyHandler(), MyRandomUnitKeyHandler(), and MyWindowHandler().
Referenced by main().
int MyCLHandler | ( | char * | argument[], |
int | maxNumArgs | ||
) |
Definition at line 226 of file Sample.cpp.
References bSaveAndQuit, doExport(), gDefaultMap, mazeSize, and Map::Save().
Referenced by InstallHandlers().
bool MyClickHandler | ( | unsigned long | windowID, |
int | x, | ||
int | y, | ||
point3d | loc, | ||
tButtonType | , | ||
tMouseEventType | |||
) |
Definition at line 442 of file Sample.cpp.
References a1, a2, kMouseDown, kMouseDrag, kMouseUp, kRightButton, ma1, ma2, mouseTracking, px1, px2, py1, py2, runningSearch2, unitSims, xyLoc::x, and xyLoc::y.
Referenced by InstallHandlers().
void MyDisplayHandler | ( | unsigned long | windowID, |
tKeyboardModifier | , | ||
char | key | ||
) |
Definition at line 258 of file Sample.cpp.
References GetActivePort(), GetNumPorts(), gStepsPerFrame, kShiftDown, MAXPORTS, SetActivePort(), SetNumPorts(), and unitSims.
Referenced by InstallHandlers().
void MyFrameHandler | ( | unsigned long | windowID, |
unsigned int | viewport, | ||
void * | data | ||
) |
Definition at line 141 of file Sample.cpp.
References a1, a2, bSaveAndQuit, gDefaultMap, gdh, gdh2, GetNumPorts(), Map::GetOpenGLCoord(), SearchEnvironment< state, action >::GetPathLength(), gStepsPerFrame, ma1, ma2, mouseTracking, GraphDistanceHeuristic::OpenGLDraw(), px1, px2, py1, py2, runningSearch1, runningSearch2, SaveScreenshot(), SearchEnvironment< state, action >::SetColor(), and unitSims.
Referenced by MyWindowHandler().
void MyPathfindingKeyHandler | ( | unsigned long | windowID, |
tKeyboardModifier | , | ||
char | key | ||
) |
Definition at line 379 of file Sample.cpp.
References GraphDistanceHeuristic::AddHeuristic(), Timer::EndTimer(), Timer::GetElapsedTime(), GraphSearchConstants::GetGraph(), MapEnvironment::GetMap(), TemplateAStar< state, action, environment, openList >::GetNodesExpanded(), node::GetNum(), TemplateAStar< state, action, environment, openList >::GetPath(), SearchEnvironment< state, action >::GetPathLength(), Graph::GetRandomNode(), GraphEnvironment::HCost(), kAvoidPlacement, kRandom, GraphEnvironment::SetDirected(), GraphMapInconsistentHeuristic::SetMode(), GraphMapInconsistentHeuristic::SetNumUsedHeuristics(), GraphDistanceHeuristic::SetPlacement(), TemplateAStar< state, action, environment, openList >::SetUseBPMX(), Timer::StartTimer(), and unitSims.
Referenced by InstallHandlers().
void MyRandomUnitKeyHandler | ( | unsigned long | windowID, |
tKeyboardModifier | , | ||
char | key | ||
) |
Definition at line 287 of file Sample.cpp.
References GraphDistanceHeuristic::AddHeuristic(), fequal(), fgreater(), fless(), gdh, gdh2, GraphDistanceHeuristic::GetGraph(), GraphSearchConstants::GetGraph(), node::GetNum(), Graph::GetRandomNode(), GraphDistanceHeuristic::HCost(), kAvoidPlacement, kFarPlacement, GraphDistanceHeuristic::SetPlacement(), and unitSims.
Referenced by InstallHandlers().
void MyWindowHandler | ( | unsigned long | windowID, |
tWindowEventType | eType | ||
) |
Definition at line 111 of file Sample.cpp.
References CreateSimulation(), gdh, gdh2, InstallFrameHandler(), kWindowCreated, kWindowDestroyed, ma1, ma2, mouseTracking, MyFrameHandler(), RemoveFrameHandler(), runningSearch1, runningSearch2, SetNumPorts(), and unitSims.
Referenced by InstallHandlers().