fixed fullscreen bug.

This commit is contained in:
Bob
2010-02-20 20:28:55 +13:00
parent a8e766932d
commit 165433d094

View File

@@ -50,7 +50,7 @@ namespace OpenRa.GlRenderer
throw new InvalidOperationException("GL Error"); throw new InvalidOperationException("GL Error");
} }
public GraphicsDevice( int width, int height, bool fullscreen, bool vsync ) public GraphicsDevice( int width, int height, bool windowed, bool vsync )
{ {
Sdl.SDL_Init(Sdl.SDL_INIT_NOPARACHUTE | Sdl.SDL_INIT_VIDEO); Sdl.SDL_Init(Sdl.SDL_INIT_NOPARACHUTE | Sdl.SDL_INIT_VIDEO);
Sdl.SDL_GL_SetAttribute(Sdl.SDL_GL_DOUBLEBUFFER, 1); Sdl.SDL_GL_SetAttribute(Sdl.SDL_GL_DOUBLEBUFFER, 1);
@@ -59,7 +59,7 @@ namespace OpenRa.GlRenderer
Sdl.SDL_GL_SetAttribute(Sdl.SDL_GL_BLUE_SIZE, 8); Sdl.SDL_GL_SetAttribute(Sdl.SDL_GL_BLUE_SIZE, 8);
Sdl.SDL_GL_SetAttribute(Sdl.SDL_GL_ALPHA_SIZE, 8); Sdl.SDL_GL_SetAttribute(Sdl.SDL_GL_ALPHA_SIZE, 8);
surf = Sdl.SDL_SetVideoMode(width, height, 0, Sdl.SDL_OPENGL | (fullscreen ? Sdl.SDL_FULLSCREEN : 0)); surf = Sdl.SDL_SetVideoMode(width, height, 0, Sdl.SDL_OPENGL | (windowed ? 0 : Sdl.SDL_FULLSCREEN));
Sdl.SDL_WM_SetCaption("OpenRA", "OpenRA"); Sdl.SDL_WM_SetCaption("OpenRA", "OpenRA");
Sdl.SDL_ShowCursor(0); Sdl.SDL_ShowCursor(0);
@@ -67,16 +67,16 @@ namespace OpenRa.GlRenderer
windowSize = new Size( width, height ); windowSize = new Size( width, height );
cgContext = Cg.cgCreateContext(); cgContext = Cg.cgCreateContext();
Cg.cgSetErrorCallback( CgErrorCallback ); Cg.cgSetErrorCallback( CgErrorCallback );
CgGl.cgGLRegisterStates( cgContext ); CgGl.cgGLRegisterStates( cgContext );
CgGl.cgGLSetManageTextureParameters( cgContext, true ); CgGl.cgGLSetManageTextureParameters( cgContext, true );
vertexProfile = CgGl.cgGLGetLatestProfile( CgGl.CG_GL_VERTEX ); vertexProfile = CgGl.cgGLGetLatestProfile( CgGl.CG_GL_VERTEX );
fragmentProfile = CgGl.cgGLGetLatestProfile( CgGl.CG_GL_FRAGMENT ); fragmentProfile = CgGl.cgGLGetLatestProfile( CgGl.CG_GL_FRAGMENT );
Console.WriteLine("VP Profile: " + vertexProfile); Console.WriteLine("VP Profile: " + vertexProfile);
Console.WriteLine("FP Profile: " + fragmentProfile); Console.WriteLine("FP Profile: " + fragmentProfile);
Gl.glEnableClientState( Gl.GL_VERTEX_ARRAY ); Gl.glEnableClientState( Gl.GL_VERTEX_ARRAY );