   GLFW says... break!
  Okay, I'd like some help here as I'm totally confused. Now I'm sure that functions called from a loop can't make it break, but that's what seems to be happening. O_oUsing GLFW, of course and here's my main loop currently set up as a test to get well... GLFW working.   do   { renderScreen(); glfwSwapBuffers(); running = glfwGetWindowParam( GLFW_OPENED ); error.WriteInt(running);   }while(running);glfwTerminate();error.Write("3");glCleanUp();As you can see, renders screen and then checks and writes if the window's opened, if it isn't running it is set to 0 and then terminated at the while check. Then '3' is written to show that the program has reached the end of it's loop. So a normal output should be something like 111111111103. '0' indicating that running is false, and thus loop ends. Instead, I start up my program, it stays open for about half a second (renders at least once) then closes. The output to error.txt is 11111111111111113, meaning that running was never equal to 0 when checked, but it somehow got out of the loop as indicated by the 3. I have no idea how this is happening, but some help would be appreciated. O_o--Aternus   
  Is "running" a global? Do you modify it anywhere else?I'd recommend using a debugger to see what's going on. I can't see any code which could modify "running" in between the WriteInt() and the while(running).Are you sure that glfwTerminate() doesn't interfere with error.Write() or WriteInt() somehow? Maybe there is some buffering in the libraries which is failing because you're doing things in the wrong order?If you're using multiple threads and "running" is a global, weirdness could happen if you didn't specify "volatile" for "running" because if "running" is modified by another thread, the code in the loop might have been optimised by the compiler not expecting it to be modified by another thread (e.g. storing "running" in a register)Mark   