c++ - An Array of ALLEGRO_BITMAP type objects -


so i'm making game using allegro , trying create array of allegro_bitmap type objects represent board, load images files @ once in beginning of game , not have load them every time want redraw them. attempted so:

allegro_bitmap files[10]; 

which gets following compilation error: 'field has incomplete type allegro_bitmap'

i tried:

allegro_bitmap* files = new allegro_bitmap[10]; 

which gets compilation error: 'allocation of incomplete type allegro_bitmap'

i have feeling has compiler not knowing size of allegro_bitmap type , therefore not knowing how allocate memory array of type (but can please correct me if i'm wrong). wondering if knew way around this? or way achieve goal of storing allegro_bitmap objects upfront rather loading image files when want redraw tile? can create 10 different variables , store files in them gross. have tried use vectors well, did not work either.

most of allegro 5 data types opaque.

you need create array of pointers:

allegro_bitmap *files[10]; files[0] = al_create_bitmap(640, 480); 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -