简体   繁体   中英

OpenGL Smooth Polygon

I am trying to make this a smooth polygon using OpenGL, but it is not doing anything. Can someone please explain what I am doing wrong?

glColor4ub(r, g, b, a);

glEnable(GL_POLYGON_SMOOTH);
glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);

glBegin(GL_QUADS);
        glVertex2i(x, y);
        glVertex2i(x1, y1);
        glVertex2i(x2, y2);
        glVertex2i(x3, y3);
glEnd();

glDisable(GL_POLYGON_SMOOTH);
glHint(GL_POLYGON_SMOOTH_HINT, GL_DONT_CARE);

Thanks in advance!

This method to smooth rendering is way out of date. It would be better to use multisampling with the GL_ARB_multisample extension.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM