Creating detached windows

Hi! This code as it is works 50% of the time, but does not work with OpenGL aka P2D.
-Libby