如何在OpenGL中绘制带有圆角的矩形?

问题描述

我正在尝试使用带有圆角的OpenGL绘制矩形(例如在css中使用border-radius时),类似于下面的示例,使用OpenGL。

enter image description here

初始化

    glutinitdisplayMode(gluT_SINGLE | gluT_RGB);
    glutinit(&argc,argv);
    glutCreateWindow("Test1");
 // The callback draw function here
    glClearColor(0,0);
    glutMainLoop();

回调绘制函数

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);
    glEnd();
 glFlush();

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)