/** * Returns the sole GLDrawableFactory instance for the desktop (X11, WGL, ..) if exist or null */ public static GLDrawableFactory getDesktopFactory() { GLProfile.initSingleton(); return nativeOSFactory; }
final static public void initSingleton(){ try{ GLProfile.initSingleton(); }catch(Exception e){ // No GLProfile.initSingleton() working -- maybe not needed } }
/** * Returns the sole GLDrawableFactory instance for EGL if exist or null */ public static GLDrawableFactory getEGLFactory() { GLProfile.initSingleton(); return eglFactory; }
public static AbstractGraphicsDevice getDefaultDevice() { initSingleton(); return defaultDevice; }
/** * Returns the availability of a profile on a device. * * @param device a valid AbstractGraphicsDevice, or <code>null</null> for the default device. * @param profile a valid GLProfile name ({@link #GL4bc}, {@link #GL4}, {@link #GL2}, ..), * or <code>[ null, GL ]</code> for the default profile. * @return true if the profile is available for the device, otherwise false. */ public static boolean isAvailable(final AbstractGraphicsDevice device, final String profile) { initSingleton(); return isAvailableImpl(getProfileMap(device, false), profile); } private static boolean isAvailableImpl(final HashMap<String /*GLProfile_name*/, GLProfile> map, final String profile) {
throws GLException initSingleton();
/** * Tries to create a OpenGL Context. * <p/> * @throws GLException when anything prevents the creation, the exception * holds the underlying problem in its "Throwable" field. */ synchronized public void iniContext() throws GLException { assert initialized == false : "The Context is already initialized!"; GLProfile.initSingleton(); GLProfile profile = null; try { if (glProfil == null) { profile = GLProfile.getMinimum(true); } else { profile = GLProfile.get(glProfil); } } catch (Throwable t) { throw new GLException("Couldn't initialize OpenGL!", t); } window = GLWindow.create(getCapabilities(profile)); initialized = true; }
GLProfile.initSingleton(); // ensure JOGL is completly initialized