/** * Do work to initialize this canvas, generally setting up the associated CanvasRenderer, etc. */ @MainThread void init();
/** * Ask the canvas to render itself. Note that this may occur in another thread and therefore a latch is given so the * caller may know when the draw has completed. * * @param latch * a counter that should be decremented once drawing has completed. */ @MainThread void draw(CountDownLatch latch);
/** * Draw the current state of the scene. */ @MainThread boolean draw();
/** * Render the object using the supplied renderer instance. * * @param renderer * @return true if a render occurred */ @MainThread boolean render(Renderer renderer); }
/** * Draw the current state of the scene. */ @MainThread boolean draw();
/** * * @param renderer * @return true if a render occurred and we should swap the buffers. */ @MainThread boolean renderUnto(Renderer renderer);
/** * Do work to initialize this canvas, generally setting up the associated CanvasRenderer, etc. */ @MainThread void init();
/** * Ask the canvas to render itself. Note that this may occur in another thread and therefore a latch is given so the * caller may know when the draw has completed. * * @param latch * a counter that should be decremented once drawing has completed. */ @MainThread void draw(CountDownLatch latch);
@MainThread public void init() { privateInit(); }
@MainThread public void init() { privateInit(); }
@MainThread public void init() { privateInit(); }
@MainThread protected ContextCapabilities createContextCapabilities() { return new LwjglContextCapabilities(GLContext.getCapabilities()); }
@MainThread protected ContextCapabilities createContextCapabilities() { return new Lwjgl3ContextCapabilities(GL.createCapabilities()); }
@MainThread protected ContextCapabilities createContextCapabilities() { return new JoglContextCapabilities(_context.getGL()); }
@MainThread public void draw(final CountDownLatch latch) { if (!_inited) { init(); } checkFocus(); _canvasRenderer.draw(); if (latch != null) { latch.countDown(); } }
@MainThread public static void preloadCache(final ITextureUtils util) { for (final Texture t : _tCache.values()) { if (t == null) { continue; } if (t.getTextureKey().getSource() != null) { util.loadTexture(t, 0); } } }
@MainThread public static void preloadCache(final Renderer r) { for (final Texture t : _tCache.values()) { if (t == null) { continue; } if (t.getTextureKey().getSource() != null) { r.loadTexture(t, 0); } } }
@MainThread public void setCursor(final MouseCursor cursor) { init(); try { final Cursor lwjglCursor = createLwjglCursor(cursor); if (lwjglCursor == null || !lwjglCursor.equals(Mouse.getNativeCursor())) { Mouse.setNativeCursor(lwjglCursor); } } catch (final LWJGLException e) { throw new RuntimeException("Unable to set cursor", e); } }
@MainThread private void privateInit() { // tell our parent to lay us out so we have the right starting size. getParent().layout(); final Rectangle size = getClientArea(); setCurrent(); final DisplaySettings settings = new DisplaySettings(Math.max(size.width, 1), Math.max(size.height, 1), 0, 0, _passedGLData.alphaSize, _passedGLData.depthSize, _passedGLData.stencilSize, _passedGLData.samples, false, _passedGLData.stereo); _canvasRenderer.init(settings, false); // false - do not do back buffer swap, swt will do that. _inited = true; }
@MainThread private void privateInit() { // tell our parent to lay us out so we have the right starting size. getParent().layout(); final Point size = getSize(); setCurrent(); final DisplaySettings settings = new DisplaySettings(Math.max(size.x, 1), Math.max(size.y, 1), 0, 0, _passedGLData.alphaSize, _passedGLData.depthSize, _passedGLData.stencilSize, _passedGLData.samples, false, _passedGLData.stereo); _canvasRenderer.init(settings, false); // false - do not do back buffer swap, swt will do that. _inited = true; }