grabbing input and hiding cursor by default

git-svn-id: svn://anubis/anaglym/trunk@28 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop 2009-09-22 22:19:50 +00:00
parent aa37258391
commit 302764c865
2 changed files with 7 additions and 0 deletions

View File

@ -26,6 +26,7 @@ Video::Video()
} }
m_surface = NULL; m_surface = NULL;
m_inputGrabbed = false;
} }
void Video::start(int width, int height, bool fullscreen) void Video::start(int width, int height, bool fullscreen)
@ -42,6 +43,10 @@ void Video::start(int width, int height, bool fullscreen)
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
m_surface = SDL_SetVideoMode(width, height, 32, flags); m_surface = SDL_SetVideoMode(width, height, 32, flags);
SDL_ShowCursor(SDL_DISABLE);
SDL_WM_GrabInput(SDL_GRAB_ON);
m_inputGrabbed = true;
m_fullscreen = fullscreen;
} }
} }

View File

@ -19,6 +19,8 @@ class Video
int m_defaultWidth; int m_defaultWidth;
int m_defaultHeight; int m_defaultHeight;
SDL_Surface * m_surface; SDL_Surface * m_surface;
bool m_fullscreen;
bool m_inputGrabbed;
}; };
#endif #endif