예제 #1
0
 /**
  * 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;
 }
예제 #2
0
 /** 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);
         }
       });
 }
예제 #3
0
 /** 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();
         }
       });
 }
예제 #4
0
 /** 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);
         }
       });
 }
예제 #5
0
 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);
 }