Beispiel #1
0
 protected Texture2D( IGraphicsDevice graphicsDevice, int width, int height, SharpDX.Direct3D9.Usage usage, int mipmapLevel = 1 )
 {
     if ( width == 0 ) width = 1;
     if ( height == 0 ) height = 1;
     texture = new SharpDX.Direct3D9.Texture ( graphicsDevice.Handle as SharpDX.Direct3D9.Device, width, height,
         mipmapLevel, usage, SharpDX.Direct3D9.Format.A8R8G8B8,
         usage.HasFlag ( SharpDX.Direct3D9.Usage.RenderTarget ) ? SharpDX.Direct3D9.Pool.Default : SharpDX.Direct3D9.Pool.Managed );
     texture.FilterTexture ( 0, SharpDX.Direct3D9.Filter.Point );
     Width = width;
     Height = height;
 }
Beispiel #2
0
 private static Microsoft.Xna.Framework.Input.ButtonState ConvertToButtonState(
     SharpDX.XInput.GamepadButtonFlags buttonFlags,
     SharpDX.XInput.GamepadButtonFlags desiredButton)
 {
     return buttonFlags.HasFlag(desiredButton) ? 
         Microsoft.Xna.Framework.Input.ButtonState.Pressed : Microsoft.Xna.Framework.Input.ButtonState.Released;
 }