Ugh, Windows API. Use GLUT instead, it's cross platform and much easier to work with. You'll probably find it in OpenGL/GLUT.h
What IDE are you using? It should be yelling at you that you have unused headers.
Gotos
, use methods instead. Let's write some pseudocode:
Code:
int main(void){
Create GLUT window
setup the GlutKeys() function
setup the GlutIdleFunc() function
Prompt for how often to do a reality check 'don't restrict to 15 min increments
call GlutMainLoop()
}
idle(){
long t = time + howoften
while (true){
if (time > t){
RealityCheck();
t = time + howoften;
}
}
}
keys(int key){
select case(key){
case 'x':
exit(0);
break;
}
}
void RealityCheck(){
Create new Glut window with RC message
}
There you go: no goto calls, no platform specific API, can set it for any time.
Bookmarks