this.drawState.program.enablePickMode(false); this.drawState.program.enableTexture(true); this.drawState.program.loadTexCoordMatrix(this.identityMatrix3);
@Override public void draw(DrawContext dc) { if (this.program == null || !this.program.useProgram(dc)) { return; // program unspecified or failed to build } if (!dc.unitSquareBuffer().bindBuffer(dc)) { return; // vertex buffer failed to bind } // Use the draw context's pick mode and use the drawable's color. this.program.enablePickMode(dc.pickMode); // Make multi-texture unit 0 active. dc.activeTextureUnit(GLES20.GL_TEXTURE0); // Disable writing to the depth buffer. GLES20.glDepthMask(false); // Use a unit square as the vertex point and vertex tex coord attributes. GLES20.glEnableVertexAttribArray(1 /*vertexTexCoord*/); // only vertexPoint is enabled by default GLES20.glVertexAttribPointer(0 /*vertexPoint*/, 2, GLES20.GL_FLOAT, false, 0, 0); GLES20.glVertexAttribPointer(1 /*vertexTexCoord*/, 2, GLES20.GL_FLOAT, false, 0, 0); // Draw this DrawableScreenTextures. this.doDraw(dc, this); // Draw all DrawableScreenTextures adjacent in the queue that share the same GLSL program. Drawable next; while ((next = dc.peekDrawable()) != null && this.canBatchWith(next)) { // check if the drawable at the front of the queue can be batched DrawableScreenTexture drawable = (DrawableScreenTexture) dc.pollDrawable(); // take it off the queue this.doDraw(dc, drawable); } // Restore the default WorldWind OpenGL state. GLES20.glDepthMask(true); GLES20.glDisableVertexAttribArray(1 /*vertexTexCoord*/); // only vertexPoint is enabled by default }
this.program.enablePickMode(dc.pickMode);
this.drawState.program.enablePickMode(dc.pickMode);
this.drawState.program.enablePickMode(dc.pickMode);