I'm trying to draw a rectangle using OpenGL with rounded corners (like when using border-radius in css), something like the example below, using OpenGL.
The initilization
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInit(&argc, argv);
glutCreateWindow("Test1");
// The callback draw function here
glClearColor(0, 0, 0, 0);
glutMainLoop();
The callback draw function
glClear(GL_COLOR_BUFFER_BIT);
int x = 0 ;
int y = 0;
glBegin(GL_POLYGON);
glVertex2d(x, y);
glVertex2d(x, y + 50);
glVertex2d(x + 100, y + 50);
glVertex2d(x + 100, y);
glVertex2d(x, y);
glEnd();
glFlush();