Refresh window

Hi all,

my software creates only a window with a few objects. I have a cube that moves over the screen. The cube receive the information of where to go via TCP/IP socket. So, to do this i use a thread to do the tcp/ip functions and the glut functions are independent. All works fine, but the glut functions only refresh when i focus the window.
What am i doing wrong? Maybe i’m using the wrong function to refresh the window? i’m using the glutPostRedisplay();

My application is testing over a Windows 98, but i will implement it in a Linux X Window.

Thanx
Leandro

This is probably a result of using multiple threads. The easy solution would be to put the socket code in the idle function.

What idle function?

It wont be a problem since my socket server will always be “listening” for a socket incoming data?

How glut will handle this?

Tnx

Check out glutIdleFunc.