@Override public void beginPoly(int windingRule) { vBuffer.clear(); /* * We don't care what the winding rule is, we disable face culling. */ gl.glDisable(GL.GL_CULL_FACE); }
gl.glDisable(GL_DEPTH_TEST);
gl.glDisable(GL.GL_DEPTH_TEST);
public void draw(GL2 gl, Set<Face> faces) { gl.glEnable(GL.GL_DEPTH_TEST); renderTextured(gl, faces); gl.glDisable(GL.GL_DEPTH_TEST); }
@Override public void setHint(Key key, Object value) { super.setHint(key, value); if (key == RenderingHints.KEY_ANTIALIASING) { if (value == RenderingHints.VALUE_ANTIALIAS_ON) { gl.glEnable(GL.GL_MULTISAMPLE); } else { gl.glDisable(GL.GL_MULTISAMPLE); } } }
@Override public void setHint(Key key, Object value) { super.setHint(key, value); if (key == RenderingHints.KEY_ANTIALIASING) { if (value == RenderingHints.VALUE_ANTIALIAS_ON) { gl.glEnable(GL.GL_MULTISAMPLE); } else { gl.glDisable(GL.GL_MULTISAMPLE); } } }
@Override public void endPoly() { drawLine(false); gl.glDisable(GL2.GL_LINE_STIPPLE); gl.glPopMatrix(); gl.glPopAttrib(); } }
@Override public void endPoly() { drawLine(false); gl.glDisable(GL2.GL_LINE_STIPPLE); gl.glPopMatrix(); gl.glPopAttrib(); } }
public static void drawCircle(GL2 gl, float x, float y, float size) { gl.glLineWidth(2); gl.glEnable(GL2.GL_LINE_SMOOTH); gl.glBegin(GL2.GL_LINE_STRIP); float f=0; for (int i=0; i<=w; i++) { gl.glVertex3d(Math.cos(f)*size + x, Math.sin(f)*size + y,0); f += incr; } gl.glEnd(); gl.glDisable(GL2.GL_LINE_SMOOTH); } }
@Override public void draw(OTFOGLDrawer drawer) { GL2 gl = OTFGLAbstractDrawable.getGl(); gl.glColor3d(1.0, 0.0, 0.0); gl.glEnable(GL.GL_BLEND); gl.glEnable(GL.GL_LINE_SMOOTH); for (Coord c : coords){ GLUtils.drawCircle(gl, (float) c.getX(), (float) c.getY(), 100); } gl.glDisable(GL.GL_LINE_SMOOTH); gl.glDisable(GL.GL_BLEND); }
@Override void resetPointAttributes(Context ctx) { if (VERBOSE) System.err.println("JoglPipeline.resetPointAttributes()"); GL2 gl = context(ctx).getGL().getGL2(); gl.glPointSize(1.0f); // XXXX: Polygon Mode check, blend enable gl.glDisable(GL2.GL_POINT_SMOOTH); }
@Override void updateMaterialColor(Context ctx, float r, float g, float b, float a) { if (VERBOSE) System.err.println("JoglPipeline.updateMaterialColor()"); GL2 gl = context(ctx).getGL().getGL2(); gl.glColor4f(r, g, b, a); gl.glDisable(GL2.GL_LIGHTING); }
private static void drawSelectedFill(Gl2Draw drawer, GL2 gl) { gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_FILL); gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); // offset polygons to front gl.glPolygonOffset(-2.0f, -2.0f); drawer.draw(gl); gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); }
@Override void updatePointAttributes(Context ctx, float pointSize, boolean pointAntialiasing) { if (VERBOSE) System.err.println("JoglPipeline.updatePointAttributes()"); GL2 gl = context(ctx).getGL().getGL2(); gl.glPointSize(pointSize); // XXXX: Polygon Mode check, blend enable if (pointAntialiasing) { gl.glEnable(GL2.GL_POINT_SMOOTH); } else { gl.glDisable(GL2.GL_POINT_SMOOTH); } }
private static void drawGreenOutline(Gl2Draw drawer, GL2 gl) { // selection color gl.glColor4fv(selectionColor, 0); gl.glDisable(GL.GL_TEXTURE_2D); SimpleOutlineDrawUtil.beginSimpleOutlineLine(gl); drawer.draw(gl); SimpleOutlineDrawUtil.beginSimpleOutlinePoint(gl); drawer.draw(gl); SimpleOutlineDrawUtil.endSimpleOutline(gl); } }
public static void beginSimpleOutlinePoint(GL2 gl) { gl.glEnable(GL.GL_CULL_FACE); gl.glCullFace(GL.GL_FRONT); gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_POINT); gl.glPointSize(6); gl.glEnable(GL2GL3.GL_POLYGON_OFFSET_POINT); // offset polygons to back gl.glPolygonOffset(2.0f, 2.0f); gl.glDisable(GLLightingFunc.GL_LIGHTING); }
private void drawHighlightEditor(GL2 gl, EditorType type, double editorRadius, float[] fillColor) { gl.glColor3fv(highlightOutlineColor, 0); SimpleOutlineDrawUtil.beginSimpleOutlineLine(gl); drawEditor(gl, editorRadius, type); SimpleOutlineDrawUtil.beginSimpleOutlinePoint(gl); drawEditor(gl, editorRadius, type); SimpleOutlineDrawUtil.endSimpleOutline(gl); gl.glDisable(GLLightingFunc.GL_LIGHTING); gl.glColor3fv(fillColor, 0); drawEditor(gl, editorRadius, type); }