/******************************************************************************************************************* * * ******************************************************************************************************************/ private void makeGList (final @Nonnull DrawContext dc) { GL gl = dc.getGL(); glListId = gl.glGenLists(1); // FIXME: what about garbaging the old one? gl.glNewList(glListId, GL.GL_COMPILE); createGList(dc, gl); gl.glEndList(); } }
final GL gl = dc.getGL(); gl.glPushAttrib(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT | GL.GL_POLYGON_BIT | GL.GL_TEXTURE_BIT | GL.GL_ENABLE_BIT
/******************************************************************************************************************* * * ******************************************************************************************************************/ private void drawBoundingVolumes(DrawContext dc, ArrayList<MercatorTextureTile> tiles) { float[] previousColor = new float[4]; dc.getGL().glGetFloatv(GL.GL_CURRENT_COLOR, previousColor, 0); dc.getGL().glColor3d(0, 1, 0); for (MercatorTextureTile tile : tiles) { ((Cylinder) tile.getExtent(dc)).render(dc); } Cylinder c = dc.getGlobe().computeBoundingCylinder(dc.getVerticalExaggeration(), this.levels.getSector()); dc.getGL().glColor3d(1, 1, 0); c.render(dc); dc.getGL().glColor4fv(previousColor, 0); }
protected void drawQuad(DrawContext dc, Vec4 a, Vec4 b, Vec4 c, Vec4 d) { GL2 gl = dc.getGL().getGL2(); gl.glBegin(GL2.GL_QUADS); gl.glVertex3d(a.x, a.y, a.z); gl.glVertex3d(b.x, b.y, b.z); gl.glVertex3d(c.x, c.y, c.z); gl.glVertex3d(d.x, d.y, d.z); gl.glEnd(); }
@Override public boolean bind( DrawContext dc ) { GL gl = dc.getGL( ); gl.glBindTexture( GL2.GL_TEXTURE_2D, textureHandle ); // these settings make fine line drawing against a transparent background appear much more natural // but can make other rendering look too jagged/crisp gl.glTexParameterf( GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR ); gl.glTexParameterf( GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR ); gl.glTexParameterf( GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP_TO_EDGE ); gl.glTexParameterf( GL2.GL_TEXTURE_2D, GL2.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP_TO_EDGE ); gl.glBlendFuncSeparate( GL2.GL_SRC_ALPHA, GL2.GL_ONE_MINUS_SRC_ALPHA, GL2.GL_ONE, GL2.GL_ONE_MINUS_SRC_ALPHA ); gl.glEnable( GL2.GL_BLEND ); //GlimpseColor.glColor( gl, GlimpseColor.getWhite( 0.5f ) ); return true; }
Arrays.sort(sortedTiles, levelComparer); GL gl = dc.getGL();
@Override public void render( DrawContext dc ) { GL2 gl = dc.getGL( ).getGL2( ); gl.glPushAttrib( GL2.GL_POLYGON_BIT ); gl.glPolygonMode( GL2.GL_FRONT, GL2.GL_FILL ); gl.glEnable( GL2.GL_CULL_FACE ); gl.glCullFace( GL2.GL_BACK ); SurfaceTileRenderer r = renderer != null ? renderer : dc.getGeographicSurfaceTileRenderer( ); if ( opacity != 1.0f ) { gl.glEnable( GL2.GL_BLEND ); gl.glBlendFunc( GL2.GL_SRC_ALPHA, GL2.GL_ONE_MINUS_SRC_ALPHA ); gl.glColor4f( 1.0f, 1.0f, 1.0f, opacity ); } else { gl.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); } try { r.renderTiles( dc, this.thisList ); } finally { gl.glPopAttrib( ); } }
GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.