From 5e9c100236dd844fcd4668a617c42e4a79cbd87b Mon Sep 17 00:00:00 2001 From: josh Date: Thu, 13 Nov 2008 23:13:30 +0000 Subject: [PATCH] added +m command-line option to disable multisampling git-svn-id: svn://anubis/dwscr/trunk@104 5bef9df8-b654-44bb-925b-0ff18baa8f8c --- dwscr.cc | 12 ++++++++++-- ss/LightBounce.cc | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dwscr.cc b/dwscr.cc index 3f0f2e0..76ffffb 100644 --- a/dwscr.cc +++ b/dwscr.cc @@ -32,6 +32,7 @@ int main(int argc, char * argv[]) int width = DEFAULT_WIDTH; int height = DEFAULT_HEIGHT; bool windowed = false; + bool multisample = true; #ifdef DEBUG start = true; @@ -58,6 +59,10 @@ int main(int argc, char * argv[]) ? argv[i] + 2 : argv[++i] ); } + else if (!strcmp("+m", argv[i])) + { + multisample = false; + } } /* make the SDL window appear in the top-left corner of the screen */ @@ -82,8 +87,11 @@ int main(int argc, char * argv[]) SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); /* Enable multisampling */ - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4); + if (multisample) + { + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4); + } int sdlMode = SDL_HWSURFACE | SDL_OPENGL; if (!windowed) diff --git a/ss/LightBounce.cc b/ss/LightBounce.cc index d002b87..4df4913 100644 --- a/ss/LightBounce.cc +++ b/ss/LightBounce.cc @@ -9,6 +9,7 @@ #include #include +#include using namespace std; #define SIZE 5