List of usage examples for org.lwjgl.opengl WGL wglCreateContext
@NativeType("HGLRC") public static long wglCreateContext(@NativeType("HDC") long hdc)
From source file:go.graphics.swing.contextcreator.WGLContextCreator.java
License:Open Source License
@Override protected void initContext() { hwnd = win32surfaceinfo.hwnd();/*from w ww. ja va 2 s .c o m*/ hdc = win32surfaceinfo.hdc(); PIXELFORMATDESCRIPTOR pfd = PIXELFORMATDESCRIPTOR.calloc(); pfd.dwFlags(GDI32.PFD_DRAW_TO_WINDOW | GDI32.PFD_SUPPORT_OPENGL | GDI32.PFD_DOUBLEBUFFER); pfd.iPixelType(GDI32.PFD_TYPE_RGBA); pfd.cColorBits((byte) 32); pfd.cStencilBits((byte) 1); pfd.cDepthBits((byte) 24); pixel_format = GDI32.ChoosePixelFormat(hdc, pfd); if (pixel_format == 0) throw new Error("Could not find pixel format!"); GDI32.SetPixelFormat(hdc, pixel_format, pfd); pfd.free(); context = WGL.wglCreateContext(hdc); if (context == 0) throw new Error("Could not create WGL context!"); }