view plaincopy to clipboardprint?
// Initialize OpenGL's rendering modes
void initRendering()
{
glEnable ( GL_DEPTH_TEST );
// Uncomment out the first block of code below, and then the second block,
// to see how they affect line and point drawing.
// The following commands should cause points and line to be drawn larger
// than a single pixel width.
glPointSize(8);
glLineWidth(5);
// The following commands should induce OpenGL to create round points and
// antialias points and lines. (This is implementation dependent unfortunately).
//RGBA mode antialias need cooperate with blend function.
glEnable(GL_POINT_SMOOTH);
glEnable(GL_LINE_SMOOTH);
glHint(GL_POINT_SMOOTH_HINT, GL_NICEST); // Make round points, not square points
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); // Antialias the lines
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
// Initialize OpenGL's rendering modes
void initRendering()
{
glEnable ( GL_DEPTH_TEST );
// Uncomment out the first block of code below, and then the second block,
// to see how they affect line and point drawing.
// The following commands should cause points and line to be drawn larger
// than a single pixel width.
glPointSize(8);
glLineWidth(5);
// The following commands should induce OpenGL to create round points and
// antialias points and lines. (This is implementation dependent unfortunately).
//RGBA mode antialias need cooperate with blend function.
glEnable(GL_POINT_SMOOTH);
glEnable(GL_LINE_SMOOTH);
glHint(GL_POINT_SMOOTH_HINT, GL_NICEST); // Make round points, not square points
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); // Antialias the lines
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
写一个openGL程序画一个点,如果没有抗锯齿,则为方形的。如果我们启动抗锯齿设置,则点是一个圆点。