.withProfileCore(true); try { Display.create(new PixelFormat(config.r + config.g + config.b, config.a, config.depth, config.stencil, config.samples), context); } catch (Exception e) { } else { Display .create(new PixelFormat(config.r + config.g + config.b, config.a, config.depth, config.stencil, config.samples)); usingGL30 = false; Display.create(new PixelFormat(0, 16, 8)); if (getDisplayMode().bitsPerPixel == 16) { bufferFormat = new BufferFormat(5, 6, 5, 0, 16, 8, 0, false); Display.create(new PixelFormat()); } catch (Exception ex3) { if (!softwareMode && config.allowSoftwareMode) {
.withProfileCore(true); try { Display.create(new PixelFormat(config.r + config.g + config.b, config.a, config.depth, config.stencil, config.samples), context); } catch (Exception e) { } else { Display .create(new PixelFormat(config.r + config.g + config.b, config.a, config.depth, config.stencil, config.samples)); usingGL30 = false; Display.create(new PixelFormat(0, 16, 8)); if (getDisplayMode().bitsPerPixel == 16) { bufferFormat = new BufferFormat(5, 6, 5, 0, 16, 8, 0, false); Display.create(new PixelFormat()); } catch (Exception ex3) { if (!softwareMode && config.allowSoftwareMode) {
/** * Try creating a display with the given format * * @param format The format to attempt * @throws LWJGLException Indicates a failure to support the given format */ private void tryCreateDisplay(PixelFormat format) throws LWJGLException { if (SHARED_DRAWABLE == null) { Display.create(format); } else { Display.create(format, SHARED_DRAWABLE); } }
/** * Create the LWJGL display * * @throws Exception Failure to create display */ private void createDisplay() throws Exception { try { // create display with alpha Display.create(new PixelFormat(8,8,GameContainer.stencil ? 8 : 0)); alphaSupport = true; } catch (Exception e) { // if we couldn't get alpha, let us know alphaSupport = false; Display.destroy(); // create display without alpha Display.create(); } }
public LWJGLGraphics(JavaPlatform plat) { super(plat, new LWJGLGL20(), Scale.ONE); // have to get scale after Display.create() setDisplayMode(plat.config.width, plat.config.height, plat.config.fullscreen); try { System.setProperty("org.lwjgl.opengl.Display.enableHighDPI", "true"); Display.create(); checkScaleFactor(); } catch (LWJGLException e) { throw new RuntimeException(e); } }
private void init() throws LWJGLException { String path = System.getProperty("user.home") + File.separator + ".fastdmm" + File.separator; Path AppDataPath = Paths.get(path); if (Files.notExists(AppDataPath)) { new File(path).mkdirs(); } String dummy = System.getProperty("user.home") + File.separator + ".fastdmm" + File.separator + "dummy"; File dummyFile = new File(dummy); if (!dummyFile.exists()) { convertintojson(); } try { synchronized (this) { while (filters == null) { wait(1000); } } } catch (InterruptedException e) { e.printStackTrace(); } setVisible(true); // Display.setDisplayMode(new DisplayMode(640, 480)); // Display.setResizable(true); Display.setParent(canvas); Display.create(); this.setTitle("FastDMM"); if (interface_dmi != null) { interface_dmi.createGL(); } }
public void init() { if (_inited) { return; } // create the Display. final PixelFormat format = new PixelFormat(_settings.getAlphaBits(), _settings.getDepthBits(), _settings.getStencilBits()).withSamples(_settings.getSamples()).withStereo(_settings.isStereo()); try { Display.setParent(_canvas); // NOTE: Workaround for possible lwjgl "pixel not accelerated" bug, as suggested by user "faust" try { Display.create(format); } catch (final LWJGLException e) { // failed to create Display, apply workaround (sleep for 1 second) and try again Thread.sleep(1000); Display.create(format); } } catch (final Exception e) { logger.severe("Cannot create window"); logger.logp(Level.SEVERE, this.getClass().toString(), "initDisplay()", "Exception", e); throw new Ardor3dException("Cannot create window: " + e.getMessage()); } _canvasRenderer.init(_settings, true); // true - do swap in renderer. _inited = true; }
Display.setTitle("Simulation"); Display.setVSyncEnabled(true); //for VSync (TZ) Display.create(); } catch (LWJGLException e) { throw new RuntimeException(e);
.withProfileCore(true); try { Display.create(new PixelFormat(config.r + config.g + config.b, config.a, config.depth, config.stencil, config.samples), context); } catch (Exception e) { } else { Display .create(new PixelFormat(config.r + config.g + config.b, config.a, config.depth, config.stencil, config.samples)); usingGL30 = false; Display.create(new PixelFormat(0, 16, 8)); if (getDisplayMode().bitsPerPixel == 16) { bufferFormat = new BufferFormat(5, 6, 5, 0, 16, 8, 0, false); Display.create(new PixelFormat()); } catch (Exception ex3) { if (!softwareMode && config.allowSoftwareMode) {
@Override public void run(final Game game) { if (!config.headless) { try { Display.create(); } catch (LWJGLException e) { throw new RuntimeException(e); } } init(game); boolean wasActive = Display.isActive(); while (!Display.isCloseRequested()) { // Notify the app if lose or regain focus (treat said as pause/resume). boolean newActive = Display.isActive(); if (wasActive != newActive) { if (wasActive) onPause(); else onResume(); wasActive = newActive; } // Process frame, if we don't need to provide true pausing if (newActive || !config.truePause) processFrame(game); Display.update(); // Sleep until it's time for the next frame. Display.sync(60); } shutdown(); }
@Override public void run(final Game game) { if (!config.headless) { try { Display.create(); } catch (LWJGLException e) { throw new RuntimeException(e); } } init(game); boolean wasActive = Display.isActive(); while (!Display.isCloseRequested()) { // Notify the app if lose or regain focus (treat said as pause/resume). boolean newActive = Display.isActive(); if (wasActive != newActive) { if (wasActive) onPause(); else onResume(); wasActive = newActive; } // Process frame, if we don't need to provide true pausing if (newActive || !config.truePause) processFrame(game); Display.update(); // Sleep until it's time for the next frame. Display.sync(60); } shutdown(); }
Display.setDisplayMode(mode); Display.setFullscreen(_settings.isFullScreen()); Display.create(format); } catch (final Exception e) { logger.severe("Cannot create window");
/** * Starts the lwjgl engine and shows a window, where the point clouds are rendered */ public void startEngine() { int width = 800; int height = 600; try { Display.setDisplayMode(new DisplayMode(width, height)); Display.setFullscreen(false); Display.setTitle("Gaalop Visualization Window"); Display.create(); } catch (LWJGLException e) { e.printStackTrace(); System.exit(0); } GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glShadeModel(GL11.GL_SMOOTH); changeSize(width, height); GL11.glDisable(GL11.GL_LIGHTING); // init OpenGL GL11.glViewport(0, 0, width, height); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); GLU.gluPerspective((float) 65.0, (float) width / (float) height, (float) 0.1, 100); GL11.glMatrixMode(GL11.GL_MODELVIEW); }