implemented multi-sampling for full-screen anti-aliasing (FSAA)

git-svn-id: svn://anubis/anaglym/trunk@86 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop 2009-10-14 03:50:03 +00:00
parent cc83d92c18
commit 3d5a5b1ecb
2 changed files with 9 additions and 2 deletions

View File

@ -31,7 +31,8 @@ Video::Video()
m_inputGrabbed = false;
}
void Video::start(int width, int height, bool fullscreen, bool grab_input)
void Video::start(int width, int height, bool fullscreen, bool grab_input,
int samples)
{
if (m_surface == NULL)
{
@ -44,6 +45,11 @@ void Video::start(int width, int height, bool fullscreen, bool grab_input)
flags |= SDL_FULLSCREEN;
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
if (samples > 1)
{
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, samples);
}
m_surface = SDL_SetVideoMode(width, height, 32, flags);
if (grab_input)
{

View File

@ -9,7 +9,8 @@ class Video
public:
Video();
void start(int width = 0, int height = 0,
bool fullscreen = true, bool grab_input = true);
bool fullscreen = true, bool grab_input = true,
int samples = 4);
void stop();
int getDefaultWidth() { return m_defaultWidth; }
int getDefaultHeight() { return m_defaultHeight; }