Wednesday 19 November 2014

So I Figured Out How to Enable Antialiasing in SDL2

So I figured out how to enable OpenGL Multisample AntiAliasing. Simply put the following before you call SDL_CreateWindow:

 SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);  
 SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, SC->multisampleLevel); 

Where SC->multisampleLevel is the multisample level. I find that values greater than 4 may crash on some machines, so I've made it so that you can only select up to 4xMSAA in the graphics option menu. If you want to go to 8x or 16x, you have to edit settings/video.txt.

And here are the before and after shots:



Get Voxel Turf at http://www.voxelturf.net/.

1 comment: