Java Examples for jogamp.nativewindow.windows.GDIUtil

The following java examples will help you to understand the usage of jogamp.nativewindow.windows.GDIUtil. These source code samples are taken from different open source projects.

Example 1
Project: jogl-master  File: WindowsWGLGraphicsConfiguration.java View source code
/**
     * Sets the hdc's PixelFormat, this configuration's capabilities and marks it as determined.
     */
final void setPixelFormat(final long hdc, final WGLGLCapabilities caps) {
    if (0 == hdc) {
        throw new GLException("Error: HDC is null");
    }
    if (!WGLUtil.SetPixelFormat(hdc, caps.getPFDID(), caps.getPFD())) {
        throw new GLException("Unable to set pixel format " + caps.getPFDID() + " of " + caps + " for device context " + toHexString(hdc) + ": error code " + GDI.GetLastError());
    }
    if (!caps.isBackgroundOpaque()) {
        GDIUtil.DwmSetupTranslucency(GDI.WindowFromDC(hdc), true);
    }
    if (DEBUG) {
        System.err.println("setPixelFormat: hdc " + toHexString(hdc) + ", " + caps);
    }
    setCapsPFD(caps);
}