public JoglPanel(final TestbedModel model, final TestbedController controller) { super(new GLCapabilities(GLProfile.getDefault())); this.controller = controller; setSize(600, 600); setPreferredSize(new Dimension(600, 600)); setAutoSwapBufferMode(true); addGLEventListener(this); AWTPanelHelper.addHelpAndPanelListeners(this, model, controller, SCREEN_DRAG_BUTTON); }
@Override public final GLProfile getGLProfile() { // FIXME: should do better than this; is it possible to query J2D's Profile ? return GLProfile.getDefault(GLProfile.getDefaultDevice()); }
/** Returns a default GLProfile object, reflecting the best for the running platform. * It selects the first of the set {@link GLProfile#GL_PROFILE_LIST_ALL} * and favors hardware acceleration. * <p>Uses the default device.</p> * @throws GLException if no profile is available for the default device. */ public static GLProfile getDefault() { return getDefault(defaultDevice); }
/** Creates a GLCapabilities object. All attributes are in a default state. * @param glp GLProfile, or null for the default GLProfile * @throws GLException if no profile is given and no default profile is available for the default device. */ public GLCapabilities(final GLProfile glp) throws GLException { glProfile = (null!=glp)?glp:GLProfile.getDefault(GLProfile.getDefaultDevice()); }
/** * set the default profile to current profile * * @return true if default profile supports shader language (GL2ES2) */ final static public boolean setDefaultProfile() { if (profile == null) { profile = GLProfile.getDefault(); isGL2ES2 = profile.isGL2ES2(); } return isGL2ES2; }
@Override public void run() { j2dFBOShareContext = GLDrawableFactory.getFactory(GLProfile.getDefault(GLProfile.getDefaultDevice())).createExternalGLContext(); } });
public vtkJoglPanelComponent(vtkRenderWindow renderWindow) { this(renderWindow, new GLCapabilities(GLProfile.getDefault())); }
final GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault(GLProfile.getDefaultDevice()) ); final Frame frame = new Frame("JOGL AWT Test");
public vtkJoglCanvasComponent(vtkRenderWindow renderWindow) { this(renderWindow, new GLCapabilities(GLProfile.getDefault())); }
final GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault(GLProfile.getDefaultDevice()) ); final Display display = new Display(); final Shell shell = new Shell(display);
protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(final X11GLXDrawableFactory factory, final AbstractGraphicsDevice device) { final X11GLXDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device); if(null == sharedResource) { throw new GLException("Shared resource for device n/a: "+device); } final X11GraphicsScreen sharedScreen = (X11GraphicsScreen) sharedResource.getScreen(); final X11GraphicsDevice sharedDevice = (X11GraphicsDevice) sharedScreen.getDevice(); final boolean isMultisampleAvailable = sharedResource.isGLXMultisampleAvailable(); final GLProfile glp = GLProfile.getDefault(device); List<GLCapabilitiesImmutable> availableCaps = null; sharedDevice.lock(); try { if( sharedResource.isGLXVersionGreaterEqualOneThree() ) { availableCaps = getAvailableGLCapabilitiesFBConfig(sharedScreen, glp, isMultisampleAvailable); } if( null == availableCaps || availableCaps.isEmpty() ) { availableCaps = getAvailableGLCapabilitiesXVisual(sharedScreen, glp, isMultisampleAvailable); } } finally { sharedDevice.unlock(); } if( null != availableCaps && availableCaps.size() > 1 ) { Collections.sort(availableCaps, XVisualIDComparator); } return availableCaps; }
caps = (GLCapabilities) userCapsRequest.cloneMutable(); } else { caps = new GLCapabilities(GLProfile.getDefault(GLProfile.getDefaultDevice()));
public static GLProfile getCompatible(final EGLGraphicsDevice device, final int renderableType) { if(0 != (renderableType & EGLExt.EGL_OPENGL_ES3_BIT_KHR) && GLProfile.isAvailable(device, GLProfile.GLES3)) { return GLProfile.get(device, GLProfile.GLES3); } if(0 != (renderableType & EGL.EGL_OPENGL_ES2_BIT) && GLProfile.isAvailable(device, GLProfile.GLES2)) { return GLProfile.get(device, GLProfile.GLES2); } if(0 != (renderableType & EGL.EGL_OPENGL_ES_BIT) && GLProfile.isAvailable(device, GLProfile.GLES1)) { return GLProfile.get(device, GLProfile.GLES1); } if(0 != (renderableType & EGL.EGL_OPENGL_BIT)) { return GLProfile.getDefault(device); } return null; }
final GLProfile glp = GLProfile.getDefault(); final GLCapabilities glcaps = new GLCapabilities(glp);
final GLCapabilities glcapsDefault = new GLCapabilities(GLProfile.getDefault()); cfg = X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(glcapsDefault, glcapsDefault, null, x11Screen, VisualIDHolder.VID_UNDEFINED); if(DEBUG) {
final GLProfile glp = GLProfile.getDefault(device);
glp = GLProfile.getDefault(screen.getDevice());
cfg = WindowsWGLGraphicsConfigurationFactory.createDefaultGraphicsConfiguration(new GLCapabilities(GLProfile.getDefault()), aScreen); cfg.markExternal(); if(DEBUG) {
@Override public NativeWindowDownstream createNativeWindow(final Applet3Context ctx, final NativeWindowUpstream parentWin) { final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault()); final Window w = NewtFactory.createWindow(parentWin.getDisplayConnection(), parentWin.getScreenIndex(), parentWin.getWindowHandle(), caps); canvas = GLWindow.create(w);
static X11GLXGraphicsConfiguration create(GLProfile glp, final X11GraphicsScreen x11Screen, final int fbcfgID) { final X11GraphicsDevice device = (X11GraphicsDevice) x11Screen.getDevice(); final long display = device.getHandle(); if(0==display) { throw new GLException("Display null of "+x11Screen); } final int screen = x11Screen.getIndex(); final long fbcfg = glXFBConfigID2FBConfig(display, screen, fbcfgID); if(0==fbcfg) { throw new GLException("FBConfig null of "+toHexString(fbcfgID)); } if(null==glp) { glp = GLProfile.getDefault(x11Screen.getDevice()); } final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory(); final X11GLCapabilities caps = GLXFBConfig2GLCapabilities(device, glp, fbcfg, GLGraphicsConfigurationUtil.ALL_BITS, factory.isGLXMultisampleAvailable(device)); if(null==caps) { throw new GLException("GLCapabilities null of "+toHexString(fbcfg)); } return new X11GLXGraphicsConfiguration(x11Screen, caps, caps, new DefaultGLCapabilitiesChooser()); }