I have created a main window and subwindow and can speak to them with glutsetwindow(main) or glutsetwindow(sub).
But after doing a fork, where my child process open another program, I want to let my father process working with my opengl windows, he can’t find the id’s of my both windows.
Following error messages appear:
Freeglut: in glutsetwindow(), window id not found.
If it is important for that i am working on a Linux system.
I am almost positive that you are uncertain as to
which process is the father and which process is the
child! I believe that you are fork()ing with a call
like this:
if(fork()) {
What happens is the father process does the work of
the child and the child is left with the windows.
Really, the roles are reversed. But you are lucky!
Simply change the fork()ing call to look like thos:
if(!fork()) {
so that the roles of parent and child are now
interchanged. It should reverse the behaviour and
the problem should be solved.
Before I want to set the MainWindow the active window with: glutSetWindow (winIdMain);
I ask for the active window with glutGetWindow() and get the answer 0. Does it mean, there is no active window at the moment? I still wonder that my subwindow is still available, it’s only my main window what’s running wrong.