fixed #989: don't do renderer setup in a reflected call.

This commit is contained in:
Chris Forbes
2011-07-04 21:05:35 +12:00
committed by Paul Chote
parent a07e151ab5
commit dcd9627c22
5 changed files with 46 additions and 19 deletions

View File

@@ -21,12 +21,17 @@ namespace OpenRA.FileFormats.Graphics
public RendererAttribute( Type graphicsDeviceType )
{
if( !typeof( IGraphicsDevice ).IsAssignableFrom( graphicsDeviceType ) )
if( !typeof( IDeviceFactory ).IsAssignableFrom( graphicsDeviceType ) )
throw new InvalidOperationException( "Incorrect type in RendererAttribute" );
Type = graphicsDeviceType;
}
}
public interface IDeviceFactory
{
IGraphicsDevice Create( Size size, WindowMode windowMode, bool vsync );
}
public interface IGraphicsDevice
{
IVertexBuffer<Vertex> CreateVertexBuffer( int length );