Java Code Examples for sun.awt.X11GraphicsEnvironment#isGLXAvailable()

The following examples show how to use sun.awt.X11GraphicsEnvironment#isGLXAvailable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GLXGraphicsConfig.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static GLXGraphicsConfig getConfig(X11GraphicsDevice device,
                                          int visualnum)
{
    if (!X11GraphicsEnvironment.isGLXAvailable()) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getGLXConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        GLXGetConfigInfo action =
            new GLXGetConfigInfo(device.getScreen(), visualnum);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new GLXGraphicsConfig(device, visualnum, cfginfo, caps);
}
 
Example 2
Source File: GLXGraphicsConfig.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static GLXGraphicsConfig getConfig(X11GraphicsDevice device,
                                          int visualnum)
{
    if (!X11GraphicsEnvironment.isGLXAvailable()) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getGLXConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        GLXGetConfigInfo action =
            new GLXGetConfigInfo(device.getScreen(), visualnum);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new GLXGraphicsConfig(device, visualnum, cfginfo, caps);
}
 
Example 3
Source File: GLXGraphicsConfig.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public static GLXGraphicsConfig getConfig(X11GraphicsDevice device,
                                          int visualnum)
{
    if (!X11GraphicsEnvironment.isGLXAvailable()) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getGLXConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        GLXGetConfigInfo action =
            new GLXGetConfigInfo(device.getScreen(), visualnum);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new GLXGraphicsConfig(device, visualnum, cfginfo, caps);
}
 
Example 4
Source File: GLXGraphicsConfig.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static GLXGraphicsConfig getConfig(X11GraphicsDevice device,
                                          int visualnum)
{
    if (!X11GraphicsEnvironment.isGLXAvailable()) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getGLXConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        GLXGetConfigInfo action =
            new GLXGetConfigInfo(device.getScreen(), visualnum);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new GLXGraphicsConfig(device, visualnum, cfginfo, caps);
}
 
Example 5
Source File: GLXGraphicsConfig.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static GLXGraphicsConfig getConfig(X11GraphicsDevice device,
                                          int visualnum)
{
    if (!X11GraphicsEnvironment.isGLXAvailable()) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getGLXConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        GLXGetConfigInfo action =
            new GLXGetConfigInfo(device.getScreen(), visualnum);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new GLXGraphicsConfig(device, visualnum, cfginfo, caps);
}
 
Example 6
Source File: GLXGraphicsConfig.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static GLXGraphicsConfig getConfig(X11GraphicsDevice device,
                                          int visualnum)
{
    if (!X11GraphicsEnvironment.isGLXAvailable()) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getGLXConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        GLXGetConfigInfo action =
            new GLXGetConfigInfo(device.getScreen(), visualnum);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new GLXGraphicsConfig(device, visualnum, cfginfo, caps);
}
 
Example 7
Source File: GLXGraphicsConfig.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static GLXGraphicsConfig getConfig(X11GraphicsDevice device,
                                          int visualnum)
{
    if (!X11GraphicsEnvironment.isGLXAvailable()) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getGLXConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        GLXGetConfigInfo action =
            new GLXGetConfigInfo(device.getScreen(), visualnum);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new GLXGraphicsConfig(device, visualnum, cfginfo, caps);
}
 
Example 8
Source File: GLXGraphicsConfig.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static GLXGraphicsConfig getConfig(X11GraphicsDevice device,
                                          int visualnum)
{
    if (!X11GraphicsEnvironment.isGLXAvailable()) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getGLXConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        GLXGetConfigInfo action =
            new GLXGetConfigInfo(device.getScreen(), visualnum);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new GLXGraphicsConfig(device, visualnum, cfginfo, caps);
}
 
Example 9
Source File: GLXGraphicsConfig.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static GLXGraphicsConfig getConfig(X11GraphicsDevice device,
                                          int visualnum)
{
    if (!X11GraphicsEnvironment.isGLXAvailable()) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getGLXConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        GLXGetConfigInfo action =
            new GLXGetConfigInfo(device.getScreen(), visualnum);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new GLXGraphicsConfig(device, visualnum, cfginfo, caps);
}
 
Example 10
Source File: GLXGraphicsConfig.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static GLXGraphicsConfig getConfig(X11GraphicsDevice device,
                                          int visualnum)
{
    if (!X11GraphicsEnvironment.isGLXAvailable()) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getGLXConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        GLXGetConfigInfo action =
            new GLXGetConfigInfo(device.getScreen(), visualnum);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new GLXGraphicsConfig(device, visualnum, cfginfo, caps);
}
 
Example 11
Source File: GLXGraphicsConfig.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static GLXGraphicsConfig getConfig(X11GraphicsDevice device,
                                          int visualnum)
{
    if (!X11GraphicsEnvironment.isGLXAvailable()) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getGLXConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        GLXGetConfigInfo action =
            new GLXGetConfigInfo(device.getScreen(), visualnum);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new GLXGraphicsConfig(device, visualnum, cfginfo, caps);
}
 
Example 12
Source File: GLXGraphicsConfig.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static GLXGraphicsConfig getConfig(X11GraphicsDevice device,
                                          int visualnum)
{
    if (!X11GraphicsEnvironment.isGLXAvailable()) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getGLXConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        GLXGetConfigInfo action =
            new GLXGetConfigInfo(device.getScreen(), visualnum);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new GLXGraphicsConfig(device, visualnum, cfginfo, caps);
}
 
Example 13
Source File: GLXGraphicsConfig.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public static GLXGraphicsConfig getConfig(X11GraphicsDevice device,
                                          int visualnum)
{
    if (!X11GraphicsEnvironment.isGLXAvailable()) {
        return null;
    }

    long cfginfo = 0;
    final String ids[] = new String[1];
    OGLRenderQueue rq = OGLRenderQueue.getInstance();
    rq.lock();
    try {
        // getGLXConfigInfo() creates and destroys temporary
        // surfaces/contexts, so we should first invalidate the current
        // Java-level context and flush the queue...
        OGLContext.invalidateCurrentContext();
        GLXGetConfigInfo action =
            new GLXGetConfigInfo(device.getScreen(), visualnum);
        rq.flushAndInvokeNow(action);
        cfginfo = action.getConfigInfo();
        if (cfginfo != 0L) {
            OGLContext.setScratchSurface(cfginfo);
            rq.flushAndInvokeNow(new Runnable() {
                public void run() {
                    ids[0] = OGLContext.getOGLIdString();
                }
            });
        }
    } finally {
        rq.unlock();
    }
    if (cfginfo == 0) {
        return null;
    }

    int oglCaps = getOGLCapabilities(cfginfo);
    ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);

    return new GLXGraphicsConfig(device, visualnum, cfginfo, caps);
}