Box2d & Allegro : Circles and rotating questions
chelneru

Hi
I want to make a pool game and I choosed Box2D for my physics. The problems I got are:

1. When I make a body in Box2D I draw it using bitmaps in Allegro. My question here is , Can I draw the bodies like primitives ? If not how can I rotate the image ? Also when I draw with bitmaps , I only get boxes because I draw the bitmaps with al_set_target_bitmap() and color it with al_clear_to_color. How can I get circles ? Because I will need mostly circles for my pool balls and holes.

Arthur Kalliokoski
taronĀ 
chelneru said:

Can I draw the bodies like primitives ?

Yes, see https://www.allegro.cc/manual/5/primitives.html

Quote:

If not how can I rotate the image ? Also when I draw with bitmaps , I only get boxes because I draw the bitmaps with al_set_target_bitmap() and color it with al_clear_to_color. How can I get circles ?

al_load_bitmap to load bitmaps from a file.
You must first initialize the image I/O addon by calling al_init_image_addon before loading any images.
al_draw_rotated_bitmap

You might possibly want to use: https://www.allegro.cc/manual/5/transformations.html

Thread #613464. Printed from Allegro.cc