Serious problem
thirdy

1st time I run my program, some functions will not work(button will not respond). Then running it again, the button that wasn't responding now responds.

miran

You need more variables!

X-G

Heathen! HTML is the answer.

thirdy

HTML? How?

miran

No, we were just joking. The real answer is that your program is broken. You need to fix it.

X-G

Also, note the implication that your post is really badly written and doesn't explain your problem at all. I just thought since apparently you weren't getting it we need to spell it out for you.

Richard Phipps

Details.. we need more details!

thirdy

My program is done in Devc++5. Project type: Win32GUI. Here's my initialization code

1int main()
2 {
3 allegro_init();
4 alfont_init();
5 
6 install_keyboard();
7 set_keyboard_rate(900, 0);
8 install_mouse();
9 install_timer();
10 set_color_depth(desktop_color_depth());
11 if(set_gfx_mode(GFX_AUTODETECT_WINDOWED,monitorx,monitory,0,0)!=0)
12 {
13 allegro_message("Please set your screen resolution larger than 800x600.");
14 return 1;
15 }
16 set_display_switch_mode(SWITCH_BACKGROUND);
17 install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT, NULL);
18
19 acquire_screen();
20
21 enable_hardware_cursor();
22 select_mouse_cursor(MOUSE_CURSOR_ARROW);
23
24 LOCK_VARIABLE(speed_counter);
25 LOCK_FUNCTION(increment_speed_counter);
26 install_int_ex(increment_speed_counter, BPS_TO_TIMER(20));
27 /*after loading all the bitmaps*/
28 show_mouse(buffer);

X-G

... that's swell. Are you going to keep linking things are completely irrelevant to your problem, or describe your problem better? Do you even want our help?

Kibiz0r

A serious problem, eh?

I only deal with silly problems. Sorry.

LennyLen

Also, why are you using acquire_screen() in your initialization routine? This function should only ever be used immediately before you perform a drawing operation.

julian_boolean
Quote:

Also, why are you using acquire_screen() in your initialization routine? This function should only ever be used immediately before you perform a drawing operation.

Don't listen to him! Hes just trying to steal your Lucky Charms.

But seriously (hehe) you might want to make a seperate function and put your initalization in there.

Kris Asick

1: acquire_screen() is one of those commands you should never call under any circumstances unless you know exactly what it does and what you can do with it. If you're using it because someone or something told you to, don't.

2: You've only posted enough code to confirm that you know how to initialize your program. If you want serious help, you need to post all relavant code, and if you're not precisely sure what's relavant and what isn't, you need to post all of it.

--- Kris Asick (Gemini)
--- http://www.pixelships.com

Thread #591478. Printed from Allegro.cc