|
i am stuck on step 2 |
krabby
Member #23,052
April 2022
|
1. generates an 800x800 initial black window |
DanielH
Member #934
January 2001
|
square is same size as window? Then just clear screen. What does the 400 mean? |
krabby
Member #23,052
April 2022
|
yes is square as windows i assume. they aren't any other square. |
krabby
Member #23,052
April 2022
|
#include <allegro.h> int main() END_OF_MAIN(); the program closing itself. how can i fix it? |
LennyLen
Member #5,313
December 2004
|
This will stop the program from closing. Pressing Esc will make it exit. I also fixed up the co-ordinates of the rectfill function for you. 1#include <allegro.h>
2
3int main()
4{
5 allegro_init();
6 install_timer(); // edit: forgot this earlier, I think it's needed. edit2: definitely needed as rest is being used, but possibly also needed for keyboard routines.
7 install_keyboard();
8
9 set_gfx_mode(GFX_AUTODETECT_WINDOWED,800,800,0,0);
10
11 rectfill(screen, 0, 0, 800,800, makecol(0,255,0));
12
13 while (!key[KEY_ESC]) {
14 rest(0);
15 }
16
17 return 0;
18
19}
20
21END_OF_MAIN()
By the way, unless you have a very good reason (eg. targeting older hardware), you'd be better learning Allegro 5 than Allegro 4, which is no longer actively developed.
|
Mark Oates
Member #1,146
March 2001
|
krabby, did you find out about Allegro recently? Where you found it, did it suggest to use Allegro 4? -- |
Chris Katko
Member #1,881
January 2002
|
please. please. stop using allegro 4. It was designed *for DOS*. (with roots going back to the *Amiga*) Allegro 5, is still C based, and a thousand times better. -----sig: |
LennyLen
Member #5,313
December 2004
|
Chris Katko said: It was designed for DOS. (with roots going back to the Amiga) I believe it was actually the Atari ST, not the Amiga.
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
Clearly this is homework, and his professor is assigning allegro 4. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Chris Katko
Member #1,881
January 2002
|
-----sig: |
Edgar Reynaldo
Major Reynaldo
May 2007
|
{"name":"5239042.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/f\/df99f7688267bbefaa703ab1d991dba4.jpg","w":375,"h":240,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/f\/df99f7688267bbefaa703ab1d991dba4"} My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|