[a5] Render some pixel data and question about threads in allegro5
komons

I have two questions. First:

How can I quickly render pixel data from unsigned char buffer with BGRA32 format into video bitmap?
At now I just copy every pixels by al_draw_pixel, but it's too slow.

Second question:

I think that a allegro threads is a solution for the first problem. But, my thread run just once. I created thread, start thread, and it still run once.

#SelectExpand
1... 2thread = al_create_thread( RedrawThread, this ); 3al_start_thread( thread ); 4... 5 6void* RedrawThread( ALLEGRO_THREAD* thread, void* arg ) 7{ 8 printf("1"); 9 return NULL; 10}

Output:
1

Why?

J-Gamer

Your thread only runs once because it exits. Shouldn't you put a while-loop in there?

komons

Okay it work, thanks. Earlier loop just make screen black. This had to be just a coincidence.

Thread #607729. Printed from Allegro.cc