I am using freeglut. I am trying to get FSAA to work, but nothing works. The sample buffers are 1, and the samples are 4. But I do not see any smoothing. Am I missing something? I am currently running Ubuntu 12.04; not sure if this will change anything.
#include <GL/glut.h> #include <GL/glext.h> #include <stdio.h> void render(void); int main(int argc, char **argv){ glutInit(&argc,argv); //Initialize the window glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_MULTISAMPLE); glutInitWindowPosition(100,100); glutInitWindowSize(200,200); glutCreateWindow("Testing"); glutDisplayFunc(render); //Enable FSAA glEnable(GL_MULTISAMPLE); //2D graphics glDisable(GL_DEPTH_TEST); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0, glutGet(GLUT_WINDOW_WIDTH), glutGet(GLUT_WINDOW_HEIGHT), 0, 0, 1); glMatrixMode(GL_MODELVIEW); GLint buf, sbuf; glGetIntegerv(GL_SAMPLE_BUFFERS, &buf); printf("number of sample buffers is %d\n", buf); glGetIntegerv(GL_SAMPLES, &sbuf); printf("number of samples is %d\n", sbuf); glutMainLoop(); return 0; } //Draw some stuff void render(void){ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClearColor(1.0f, 1.0f, 1.0f, 1.0f); glColor3f(0.0f,1.0f,0.0f); glBegin(GL_LINE_LOOP); glVertex2f(10.0,10.0); glVertex2f(170.0,60.0); glVertex2f(50.0,130.0); glVertex2f(50.0,60.0); glEnd(); glutSwapBuffers(); }
I know SDL and GLFW well. I would like to make it work in freeglut, though.
Additional Information:
Video Card: ATI Radeon HD 4250
OpenGL Version: 3.3.11627 Compatibility Profile Context
source share