- Online Community Forums » Programming Questions » [a5] Render some pixel data and question about threads in allegro5

This thread is locked; no one can reply to it. rss feed Print
[a5] Render some pixel data and question about threads in allegro5
Member #11,083
June 2009

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.

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}



Member #12,491
January 2011

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

" There are plenty of wonderful ideas in The Bible, but God isn't one of them." - Derezo
"If your body was a business, thought would be like micro-management and emotions would be like macro-management. If you primarily live your life with emotions, then you are prone to error on the details. If you over-think things all the time you tend to lose scope of priorities." - Mark Oates

Member #11,083
June 2009

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

Go to: