/** * Returns a (created on demand, then cached) image used when filling solid color quads or * triangles. */ Image fillImage() { if (fillImage == null) { CanvasImage image = platform.graphics().createImage(1, 1); image.canvas().setFillColor(0xFFFFFFFF).fillRect(0, 0, image.width(), image.height()); fillImage = image; } return fillImage; }
/** Queues a framebuffer to be destroyed on the GL thread. */ public void queueDeleteFramebuffer(final int fbuf) { platform.invokeLater( new Runnable() { public void run() { deleteFramebuffer(fbuf); } }); }
/** Queues a custom shader to be cleaned up on the GL thread. */ public void queueClearShader(final GLShader shader) { platform.invokeLater( new Runnable() { public void run() { shader.clearProgram(); } }); }
/** Queues a texture to be destroyed on the GL thread. */ public void queueDestroyTexture(final int tex) { platform.invokeLater( new Runnable() { public void run() { destroyTexture(tex); } }); }
protected GLShader createQuadShader() { if (shouldTryQuadShader()) { try { GLShader quadShader = new QuadShader(this); quadShader.createCore(); // force core creation to test whether it fails return quadShader; } catch (Throwable t) { platform.reportError("Failed to create QuadShader", t); } } return new IndexedTrisShader(this); }