split IGraphicsDevice.{Present,PumpInput}

This commit is contained in:
Chris Forbes
2011-05-22 22:10:48 +12:00
parent 77686adc1a
commit 5ecc1ebefc
5 changed files with 16 additions and 5 deletions

View File

@@ -38,7 +38,8 @@ namespace OpenRA.FileFormats.Graphics
int GpuMemoryUsed { get; } int GpuMemoryUsed { get; }
void Clear( Color color ); void Clear( Color color );
void Present( IInputHandler inputHandler ); void Present();
void PumpInput(IInputHandler inputHandler);
void DrawPrimitives( PrimitiveType type, int firstVertex, int numVertices ); void DrawPrimitives( PrimitiveType type, int firstVertex, int numVertices );

View File

@@ -94,7 +94,8 @@ namespace OpenRA.Graphics
public void EndFrame( IInputHandler inputHandler ) public void EndFrame( IInputHandler inputHandler )
{ {
Flush(); Flush();
device.Present( inputHandler ); device.PumpInput(inputHandler);
device.Present();
} }
public void DrawBatch<T>(IVertexBuffer<T> vertices, public void DrawBatch<T>(IVertexBuffer<T> vertices,

View File

@@ -181,9 +181,13 @@ namespace OpenRA.Renderer.Cg
} }
} }
public void Present( IInputHandler inputHandler ) public void Present()
{ {
Sdl.SDL_GL_SwapBuffers(); Sdl.SDL_GL_SwapBuffers();
}
public void PumpInput( IInputHandler inputHandler )
{
Game.HasInputFocus = 0 != ( Sdl.SDL_GetAppState() & Sdl.SDL_APPINPUTFOCUS ); Game.HasInputFocus = 0 != ( Sdl.SDL_GetAppState() & Sdl.SDL_APPINPUTFOCUS );
var mods = MakeModifiers( Sdl.SDL_GetModState() ); var mods = MakeModifiers( Sdl.SDL_GetModState() );

View File

@@ -180,9 +180,13 @@ namespace OpenRA.Renderer.Glsl
} }
} }
public void Present( IInputHandler inputHandler ) public void Present()
{ {
Sdl.SDL_GL_SwapBuffers(); Sdl.SDL_GL_SwapBuffers();
}
public void PumpInput( IInputHandler inputHandler )
{
Game.HasInputFocus = 0 != ( Sdl.SDL_GetAppState() & Sdl.SDL_APPINPUTFOCUS ); Game.HasInputFocus = 0 != ( Sdl.SDL_GetAppState() & Sdl.SDL_APPINPUTFOCUS );
var mods = MakeModifiers( Sdl.SDL_GetModState() ); var mods = MakeModifiers( Sdl.SDL_GetModState() );

View File

@@ -33,7 +33,8 @@ namespace OpenRA.Renderer.Null
public void Clear(Color c) { } public void Clear(Color c) { }
public void Present(IInputHandler ih) public void Present() { }
public void PumpInput(IInputHandler ih)
{ {
Game.HasInputFocus = false; Game.HasInputFocus = false;
ih.ModifierKeys(Modifiers.None); ih.ModifierKeys(Modifiers.None);