Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Serious problem

This thread is locked; no one can reply to it. rss feed Print
Serious problem
thirdy
Member #8,409
March 2007
avatar

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
Member #2,407
June 2002

You need more variables!

--
sig used to be here

X-G
Member #856
December 2000
avatar

Heathen! HTML is the answer.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

thirdy
Member #8,409
March 2007
avatar

HTML? How?

miran
Member #2,407
June 2002

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

--
sig used to be here

X-G
Member #856
December 2000
avatar

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.

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Richard Phipps
Member #1,632
November 2001
avatar

thirdy
Member #8,409
March 2007
avatar

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
Member #856
December 2000
avatar

... 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?

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Kibiz0r
Member #6,203
September 2005
avatar

A serious problem, eh?

I only deal with silly problems. Sorry.

LennyLen
Member #5,313
December 2004
avatar

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
Member #8,201
January 2007

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
Member #1,424
July 2001

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

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

Go to: