@Override public boolean bindTexture(DrawContext dc) { return (this.texture != null) && this.texture.bindTexture(dc); }
protected void doDraw(DrawContext dc, DrawableScreenTexture drawable) { // Use the drawable's color. drawable.program.loadColor(drawable.color); // Attempt to bind the drawable's texture, configuring the shader program appropriately if there is no texture // or if the texture failed to bind. if (drawable.texture != null && drawable.texture.bindTexture(dc)) { drawable.program.enableTexture(true); drawable.program.loadTexCoordMatrix(drawable.texture.getTexCoordTransform()); } else { drawable.program.enableTexture(false); } // Use a modelview-projection matrix that transforms the unit square to screen coordinates. drawable.mvpMatrix.setToMultiply(dc.screenProjection, drawable.unitSquareTransform); drawable.program.loadModelviewProjection(drawable.mvpMatrix); // Disable depth testing if requested. if (!drawable.enableDepthTest) { GLES20.glDisable(GLES20.GL_DEPTH_TEST); } // Draw the unit square as triangles. GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4); // Restore the default WorldWind OpenGL state. if (!drawable.enableDepthTest) { GLES20.glEnable(GLES20.GL_DEPTH_TEST); } }
if (!colorAttachment.bindTexture(dc)) { return; // framebuffer texture failed to bind
if (!depthTexture.bindTexture(dc)) { return; // framebuffer texture failed to bind
this.drawState.program.loadColor(prim.color); if (prim.texture != null && prim.texture.bindTexture(dc)) { this.drawState.program.loadTexCoordMatrix(prim.texCoordMatrix); this.drawState.program.enableTexture(true);
boolean textureBound = this.nightTexture != null && this.nightTexture.bindTexture(dc);
this.drawState.program.loadColor(prim.color); if (prim.texture != null && prim.texture.bindTexture(dc)) { this.drawState.program.loadTexCoordMatrix(prim.texCoordMatrix); this.drawState.program.enableTexture(true);