wglMakeCurrent() public static méthode

public static wglMakeCurrent ( IntPtr hDc, IntPtr newContext ) : Boolean
hDc IntPtr
newContext IntPtr
Résultat Boolean
Exemple #1
0
 /// <summary>
 ///
 /// </summary>
 public void MakeCurrent()
 {
     // Are we not able to activate the rending context?
     //if(deviceContext == IntPtr.Zero || renderingContext == IntPtr.Zero || !Wgl.wglMakeCurrent(deviceContext, renderingContext)) {
     if (!Wgl.wglMakeCurrent(deviceContext, renderingContext))
     {
         MessageBox.Show("Can not activate the GL rendering context.", "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Environment.Exit(-1);
     }
 }
Exemple #2
0
        // --- Public Methods ---
        #region DestroyContexts()
        /// <summary>
        ///
        /// </summary>
        public void DestroyContexts()
        {
            if (renderingContext != IntPtr.Zero)
            {
                Wgl.wglMakeCurrent(IntPtr.Zero, IntPtr.Zero);
                Wgl.wglDeleteContext(renderingContext);
                renderingContext = IntPtr.Zero;
            }

            if (deviceContext != IntPtr.Zero)
            {
                if (windowHandle != IntPtr.Zero)
                {
                    User.ReleaseDC(windowHandle, deviceContext);
                }
                deviceContext = IntPtr.Zero;
            }
        }