MakeContextCurrent() public static method

public static MakeContextCurrent ( GlfwWindowPtr window ) : void
window GlfwWindowPtr
return void
Exemplo n.º 1
0
        public override void MakeCurrent(IWindowInfo info)
        {
            var glfwWindowInfo = (PixelFarm.GlfwWinInfo)info;

            Glfw.MakeContextCurrent(glfwWindowInfo.GlfwWindowPtr);

            Thread new_thread = Thread.CurrentThread;

            // A context may be current only on one thread at a time.
            if (current_thread != null && new_thread != current_thread)
            {
                throw new GraphicsContextException(
                          "Cannot make context current on two threads at the same time");
            }

            if (info != null)
            {
                current_thread = Thread.CurrentThread;
            }
            else
            {
                current_thread = null;
            }
        }