|
Timer |
Rick
Member #3,572
June 2003
|
install_int(GodClock, 1); This statment makes the timer get called every millisecond right? There are 1000 milliseconds in a second right? So if I want to say simulate a year to equal 30 seconds, I could take (int)CurrentTime/30000 This would give me the year rught? Doesn't seem to work. [EDIT] ======================================================== |
ReyBrujo
Moderator
January 2001
|
What is CurrentTime? How you got it? With time? -- |
Rick
Member #3,572
June 2003
|
Actually I would open the windows clock to time when the year changed. But turns out the timer doesn't run when that window isn't the active window. So it works as long as it's the active window. I didn't know that. ======================================================== |
ReyBrujo
Moderator
January 2001
|
Have you tried set_display_switch_mode(SWITCH_BACKGROUND) at the begining of your program, to keep the program running when not with focus? -- |
Rick
Member #3,572
June 2003
|
Never used that before. I'll give that a try. [EDIT] ======================================================== |
ReyBrujo
Moderator
January 2001
|
Then try SWITCH_BACKAMNESIA instead of the other. Let me see if I understand: You have your application running in a window. And it works only when the window has focus, when you give focus to something else, it loses it and the program stops, right? -- |
Rick
Member #3,572
June 2003
|
That's what I'm thinking? I display the timer, and when someother window has focus the timer stops. [EDIT] ======================================================== |
ReyBrujo
Moderator
January 2001
|
For Windows, use set_display_switch_mode(SWITCH_BACKGROUND), but call it AFTER setting the graphic mode. -- |
Rick
Member #3,572
June 2003
|
perfect, thank you. ======================================================== |
Kitty Cat
Member #2,815
October 2002
|
For optimal results, you should do: if(set_display_switch_mode(SWITCH_BACKAMNESIA) == -1) set_display_switch_mode(SWITCH_BACKGROUND); In Windows, fullscreen modes will only work in the background with BACKAMNESIA, while windowed modes will only work with BACKGROUND. I'm not sure, but I think there was talk about making BACKAMNESIA fall back onto BACKGROUND for newer Allegro versions (since it doesn't break anything by using BACKGROUND when BACKAMNESIA is requested). I'll have to ask about that. -- |
|