I am using freeglut. I'm trying to get FSAA working, but nothing seems to work. Sample buffers is 1 and Samples is 4. But I'm not seeing any anti-aliasing. Am I missing something? Currently, I am running Ubuntu 12.04; not sure if that changes 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 am well aware of SDL and GLFW. I'd like to get it working in freeglut though.
More info:
Graphics card:ATI Radeon HD 4250
OpenGL version: 3.3.11627 Compatibility Profile Context
GL_TRIANGLE_FAN
orGL_QUAD_STRIP
. Isn't multisampling supposed to antialias those? – Unstable