PDA

View Full Version : Refresh window



leandro
05-31-2001, 09:26 AM
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

05-31-2001, 01:19 PM
This is probably a result of using multiple threads. The easy solution would be to put the socket code in the idle function.

leandro
05-31-2001, 04:56 PM
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

06-01-2001, 04:08 PM
Check out glutIdleFunc.