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]
It's in windowed mode, and it like I have to alt-tab back and forth for it to update.
What is CurrentTime? How you got it? With time?
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.
Have you tried set_display_switch_mode(SWITCH_BACKGROUND) at the begining of your program, to keep the program running when not with focus?
Never used that before. I'll give that a try.
[EDIT]
Didn't work
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?
That's what I'm thinking? I display the timer, and when someother window has focus the timer stops.
[EDIT]
That didn't work either. Where should that function be called? I put it right after allegro_init()
For Windows, use set_display_switch_mode(SWITCH_BACKGROUND), but call it AFTER setting the graphic mode.
perfect, thank you.
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.