Example usage for org.lwjgl.opengl WGL wglDeleteContext

List of usage examples for org.lwjgl.opengl WGL wglDeleteContext

Introduction

In this page you can find the example usage for org.lwjgl.opengl WGL wglDeleteContext.

Prototype

@NativeType("BOOL")
public static boolean wglDeleteContext(@NativeType("HGLRC") long context) 

Source Link

Document

Deletes a specified OpenGL rendering context.

Usage

From source file:com.google.gapid.glcanvas.GlCanvas.java

License:Apache License

public GlCanvas(Composite parent, int style) {
    super(parent, checkStyle(parent, style));
    Canvas dummy = new Canvas(parent, style);
    parent.getDisplay().setData(USE_OWNDC_KEY, Boolean.FALSE);

    Context dummyContext = new Context(dummy.handle).createSimplePixelFormat().createContext();
    if (dummyContext.createPixelFormat()) {
        context = new Context(handle).setPixelFormat(dummyContext.pixelFormat).createContext().context;
    } else {/*from   w ww  .jav a  2s  .c  om*/
        context = new Context(handle).createSimplePixelFormat().createContext().context;
    }
    dummyContext.release();
    dummy.dispose();

    addListener(SWT.Dispose, e -> {
        terminate();
        WGL.wglDeleteContext(context);
    });
}

From source file:go.graphics.swing.contextcreator.WGLContextCreator.java

License:Open Source License

@Override
public void stop() {
    WGL.wglDeleteContext(context);
}