本文整理汇总了C#中SharpDX.HasFlag方法的典型用法代码示例。如果您正苦于以下问题:C# SharpDX.HasFlag方法的具体用法?C# SharpDX.HasFlag怎么用?C# SharpDX.HasFlag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpDX
的用法示例。
在下文中一共展示了SharpDX.HasFlag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Texture2D
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;
}
示例2: ConvertToButtonState
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;
}