|
[a5] Render some pixel data and question about threads in allegro5 |
komons
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? 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}
Output: Why? |
J-Gamer
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 |
komons
Member #11,083
June 2009
|
Okay it work, thanks. Earlier loop just make screen black. This had to be just a coincidence. |
|