Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » How you clear the screen with Allegro?

This thread is locked; no one can reply to it. rss feed Print
How you clear the screen with Allegro?
Hotshot2007
Member #8,191
January 2007

Hiya all,

I have made pong game in allegro but I have one problem....clear the screen

I know in Basic used "cls" but for allegro? they dont even have cls or clear the screen for image!

does anyone know please?

one more questions....is there a tutorial for Typedef in allegro because I would like to more about Allegro.

cheers

Richard Phipps
Member #1,632
November 2001
avatar

Tomoso
Member #3,128
January 2003
avatar

You shouldn't be clearing the screen, instead if your using double buffering, clear the bitmap your drawing to before you draw to the screen.

// Create Buffer Bitmap
BITMAP* buffer = create_bitmap(screen_w, screen_h);

// Logic

// Draw
clear_bitmap(buffer);

// Draw Everying to the buffer here

// And finally draw the buffer to the screen
blit(buffer, screen, 0, 0, 0, 0, screen_w, screen_h);

Lazy Noob - Blog

Onewing
Member #6,152
August 2005
avatar

Quote:

is there a tutorial for Typedef in allegro because I would like to more about Allegro.

typedef is a C keyword, it has nothing to do with allegro.

As per the rest of your question, do as RP suggests and read the online manual.

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Hotshot2007
Member #8,191
January 2007

May I ask...where is the manual ?

thank you

cheers

Audric
Member #907
January 2001

google allegro manual

Hotshot2007
Member #8,191
January 2007

thank you everyone and I will try post the pong allegro as it is my first attempt coding.

cheers

Jonatan Hedborg
Member #4,886
July 2004
avatar

uargh. For all that is good and holy RTFM. If not in your allegro distribution, on the main-page of this site. Under "manual".

I swear to god, it's like WoW has closed down and all the noobs there came here wanting to make a new one.
(no not so much offense to OP)

Maybe we should put the FAQ the top of every page, in bold font, with a warning? (failure to read FAQ will result in public ridicule and possibly removal of thread)

Hotshot2007
Member #8,191
January 2007

excuse me....I am deaf person who are first timer on here and I agree that you should have all the newbie who should read FAQ FIRST before posting the topic.

cheers

Neil Walker
Member #210
April 2000
avatar

Perhaps then you need to really learn C before delving into the complexities of third party libraries?

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Audric
Member #907
January 2001

Hotshot2007 said:

I have made pong game

- want to make -, then. It's ok, pong is the classic "first game" to attempt, everybody would give this hint.

You'll see the allegro examples (in the source distribution) are a great help : you can change a parameter in them, recompile, and run to see the result.

Go to: