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:
parent
cc83d92c18
commit
3d5a5b1ecb
8
Video.cc
8
Video.cc
@ -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)
|
||||
{
|
||||
|
3
Video.h
3
Video.h
@ -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; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user