Example usage for org.lwjgl.opengl GLX glXCreateContext

List of usage examples for org.lwjgl.opengl GLX glXCreateContext

Introduction

In this page you can find the example usage for org.lwjgl.opengl GLX glXCreateContext.

Prototype

@NativeType("GLXContext")
public static long glXCreateContext(@NativeType("Display *") long display,
        @NativeType("XVisualInfo *") XVisualInfo visual, @NativeType("GLXContext") long share_list,
        @NativeType("Bool") boolean direct) 

Source Link

Document

Creates an OpenGL context.

Usage

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

License:Open Source License

@Override
protected void initContext() {
    display = x11surfaceinfo.display();// w  ww  .ja v a  2s . com

    int[] xvi_attrs = new int[] { GLX.GLX_RGBA, GLX.GLX_DOUBLEBUFFER, GLX.GLX_STENCIL_SIZE, 1, 0 };

    int screen = X11.XDefaultScreen(display);
    XVisualInfo xvi = GLX.glXChooseVisual(display, screen, xvi_attrs);

    context = GLX.glXCreateContext(display, xvi, 0, true);
    if (context == 0)
        throw new Error("Could not create GLX context!");
}