I’m now using Mikkel’s code exactly and the following code generates a
triangle with no antialiasing. I have GeForceFX 5900 Ultra and the driver has
FSAA set to “Application Controlled”. My main.cpp is:
#pragma comment(lib, “opengl32.lib”)
#pragma comment(lib, “glut32.lib”)
#pragma comment(lib, “glu32.lib”)
#pragma comment(lib, “sdl.lib”)
#pragma comment(lib, “sdlmain.lib”)
#include <windows.h>
#include <SDL.h>
#include <gl/gl.h>
int main(int argc, char** argv) {
if (SDL_Init(SDL_INIT_NOPARACHUTE | SDL_INIT_VIDEO) < 0) {
OutputDebugString("SDL_Init failed\n");
return -1;
}
SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 8);
SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8);
SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 8);
SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 8);
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute( SDL_GL_MULTISAMPLEBUFFERS, 1);
SDL_GL_SetAttribute( SDL_GL_MULTISAMPLESAMPLES, 4);
SDL_Surface* screen = SDL_SetVideoMode(640, 480, 32,
SDL_OPENGL|SDL_OPENGLBLIT);
while (true) {
glClear(GL_COLOR_BUFFER_BIT);
glViewport(0,0,640,480);
glColor3f(1, 1, 1);
glCullFace(GL_NONE);
glBegin(GL_TRIANGLES);
glVertex3f(-1,-1,-1);
glVertex3f( 1,-1,-1);
glVertex3f( 0, 1,-1);
glEnd();
SDL_GL_SwapBuffers();
SDL_Event event;
while (SDL_PollEvent(&event)) {
switch(event.type) {
case SDL_QUIT:
exit(0);
break;
}
}
}
return 0;
}
Can someone confirm that this code works for them? It doesn’t create any FSAA
for me. I’ll happily send you a binary to try as well, just e-mail me.
-m__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/