I have been trying to render a 2D circle on a GUI. Here is what I ended up with after a lot of google searches:
public static void drawCirc(double p_73734_0_, double p_73734_1_, double p_73734_2_, int p_73734_4_) {
float var10 = (float) (p_73734_4_ >> 24 & 255) / 255.0F;
float var6 = (float) (p_73734_4_ >> 16 & 255) / 255.0F;
float var7 = (float) (p_73734_4_ >> 8 & 255) / 255.0F;
float var8 = (float) (p_73734_4_ & 255) / 255.0F;
double increment = 2*Math.PI/50;
double cx = p_73734_0_;
double cy = p_73734_1_;
double radius = p_73734_2_;
GL11.glColor4f(var6, var7, var8, var10);
for(double angle = 0; angle < 2*Math.PI; angle+=increment){
GL11.glBegin(GL11.GL_POLYGON);
GL11.glVertex2d(cx,cy);
GL11.glVertex2d(cx + Math.cos(angle)* radius, cy +
Math.sin(angle)*radius);
GL11.glVertex2d(cx + Math.cos(angle + increment)*radius, cy +
Math.sin(angle + increment)*radius);
GL11.glEnd();
}
}
However, it is not rendering. Nothing is coming up. I have tried a variety of tweaks to this code, but nothing is working.
I am unsure if mc's default tesselator is overriding my vertex's and stopping it from rendering or if I am being stupid, but no matter what I try, it doesn't render a circle.
I am hoping after I figure out how to render a circle, I can try rendering a rounded rectangle, but so far, it does not look promising. I am hoping someone on here knows how to do this correctly.