opegl and serial port
Hi,all
I'm using glut and read from serial port(RS232) with a thread, when I receive a special frame redraw window with glutPostRedisplay function.
My code work correctly in windows but in linux (fedora core 8) doesn't work correctly.
My code is similar this :
---->main
glutinitialize.
create serial read thread.
glutMainLoop();
---->serial read thread
while(1)
{
readSerial();**1**
if(DataChanged())
glutPostRedisplay();
}
This code work in windows, but in linux redisplay doesn't happen until I press a key or move or click the mouse.
when I replace **1** with sleep(1) and set random data it's similar above but if I remove **1** and set random data the display redraw about evry 300 mili second.
If you know the problem or mistake please help me.
|