• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TextureFlags类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TextureFlags的典型用法代码示例。如果您正苦于以下问题:C# TextureFlags类的具体用法?C# TextureFlags怎么用?C# TextureFlags使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TextureFlags类属于命名空间,在下文中一共展示了TextureFlags类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: TextureItem

 public TextureItem(TexturePackage package, string name, TextureFlags flags)
 {
     Package = package;
     Name = name;
     Flags = flags;
     _subItems = new Dictionary<TextureSubItemType, TextureSubItem>();
 }
开发者ID:silky,项目名称:sledge,代码行数:7,代码来源:TextureItem.cs


示例2: New1D

 private static TextureDescription New1D(int width, PixelFormat format, TextureFlags flags, int mipCount, int arraySize, GraphicsResourceUsage usage)
 {
     usage = (flags & TextureFlags.UnorderedAccess) != 0 ? GraphicsResourceUsage.Default : usage;
     var desc = new TextureDescription()
     {
         Dimension = TextureDimension.Texture1D,
         Width = width,
         Height = 1,
         Depth = 1,
         ArraySize = arraySize,
         Flags = flags,
         Format = format,
         MipLevels = Texture.CalculateMipMapCount(mipCount, width),
         Usage = Texture.GetUsageWithFlags(usage, flags),
     };
     return desc;
 }
开发者ID:Powerino73,项目名称:paradox,代码行数:17,代码来源:TextureDescription.Extensions1D.cs


示例3: New3D

        private static TextureDescription New3D(int width, int height, int depth, PixelFormat format, TextureFlags flags, int mipCount, GraphicsResourceUsage usage)
        {
            var desc = new TextureDescription()
            {
                Width = width,
                Height = height,
                Depth = depth,
                Flags = flags,
                Format = format,
                MipLevels = Texture.CalculateMipMapCount(mipCount, width, height, depth),
                Usage = Texture.GetUsageWithFlags(usage, flags),
                ArraySize = 1,
                Dimension = TextureDimension.Texture3D,
                MultiSampleLevel = MSAALevel.None
            };

            return desc;
        } 
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:18,代码来源:TextureDescription.Extensions3D.cs


示例4: New2D

        private static TextureDescription New2D(int width, int height, PixelFormat format, TextureFlags textureFlags, int mipCount, int arraySize, GraphicsResourceUsage usage)
        {
            if ((textureFlags & TextureFlags.UnorderedAccess) != 0)
                usage = GraphicsResourceUsage.Default;

            var desc = new TextureDescription()
            {
                Dimension = TextureDimension.Texture2D,
                Width = width,
                Height = height,
                Depth = 1,
                ArraySize = arraySize,
                MultiSampleLevel = MSAALevel.None,
                Flags = textureFlags,
                Format = format,
                MipLevels = Texture.CalculateMipMapCount(mipCount, width, height),
                Usage = Texture.GetUsageWithFlags(usage, textureFlags),
            };
            return desc;
        }
开发者ID:cg123,项目名称:xenko,代码行数:20,代码来源:TextureDescription.Extensions2D.cs


示例5: Create

        public static GLTexture Create(string name, Bitmap bitmap, int width, int height, TextureFlags flags)
        {
            if (Exists(name)) {
                Delete(name);
            }
            var actualBitmap = bitmap;
            if (ForceNonPowerOfTwoResize || !SupportsNonPowerOfTwo())
            {
                var w = NextPowerOfTwo(bitmap.Width);
                var h = NextPowerOfTwo(bitmap.Height);
                if (w != bitmap.Width || h != bitmap.Height) actualBitmap = new Bitmap(bitmap, w, h);
            }
            var data = actualBitmap.LockBits(
                new Rectangle(0, 0, actualBitmap.Width, actualBitmap.Height),
                ImageLockMode.ReadOnly,
                System.Drawing.Imaging.PixelFormat.Format32bppArgb
                );
            var tex = CreateAndBindTexture();
            SetTextureParameters();
            GL.TexImage2D(
                TextureTarget.Texture2D,
                0,
                PixelInternalFormat,
                data.Width,
                data.Height,
                0,
                PixelFormat.Bgra,
                PixelType.UnsignedByte,
                data.Scan0
                );

            actualBitmap.UnlockBits(data);
            if (actualBitmap != bitmap)
            {
                actualBitmap.Dispose();
            }
            var texobj = new GLTexture(tex, name, flags) { Width = width, Height = height };
            Textures.Add(name, texobj);
            return texobj;
        }
开发者ID:silky,项目名称:sledge,代码行数:40,代码来源:TextureHelper.cs


示例6: New

 /// <summary>
 /// Creates a new <see cref="RenderTargetCube" />.
 /// </summary>
 /// <param name="device">The <see cref="GraphicsDevice"/>.</param>
 /// <param name="size">The size (in pixels) of the top-level faces of the cube texture.</param>
 /// <param name="mipCount">Number of mipmaps, set to true to have all mipmaps, set to an int >=1 for a particular mipmap count.</param>
 /// <param name="format">Describes the format to use.</param>
 /// <param name="flags">Sets the texture flags (for unordered access...etc.)</param>
 /// <returns>A new instance of <see cref="RenderTargetCube" /> class.</returns>
 /// <msdn-id>ff476521</msdn-id>
 ///   <unmanaged>HRESULT ID3D11Device::CreateTexture2D([In] const D3D11_TEXTURE2D_DESC* pDesc,[In, Buffer, Optional] const D3D11_SUBRESOURCE_DATA* pInitialData,[Out, Fast] ID3D11Texture2D** ppTexture2D)</unmanaged>
 ///   <unmanaged-short>ID3D11Device::CreateTexture2D</unmanaged-short>
 public static RenderTargetCube New(GraphicsDevice device, int size, MipMapCount mipCount, PixelFormat format, TextureFlags flags = TextureFlags.RenderTarget | TextureFlags.ShaderResource)
 {
     return new RenderTargetCube(device, NewRenderTargetDescription(size, format, flags | TextureFlags.RenderTarget, mipCount));
 }
开发者ID:pH200,项目名称:SharpDX,代码行数:16,代码来源:RenderTargetCube.cs


示例7: MyTexture

 /// <summary>
 /// Initializes a new instance of the <see cref="MyTexture"/> class.
 /// </summary>
 /// <param name="path">The path.</param>
 /// <param name="manager">The manager.</param>
 /// <param name="loadMethod">The load method. See <code>LoadMethod</code> enum.</param>
 /// <param name="flags">The flags.</param>
 protected MyTexture(string path, LoadMethod loadMethod, TextureFlags flags)
 {
     this.flags = flags;
     this.Name = path;
     //  this.Manager = manager;
     switch (loadMethod)
     {
         case LoadMethod.External:
             this.LoadState = LoadState.Pending;
             break;
         case LoadMethod.Lazy:
             this.LoadState = LoadState.LoadYourself;
             break;
         case LoadMethod.LazyBackground:
             this.LoadState = LoadState.LoadYourselfBackground;
             break;
         default:
             throw new ArgumentOutOfRangeException("loadMethod");
     }
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:27,代码来源:MyTexture.cs


示例8: bgfx_create_frame_buffer

 public static extern ushort bgfx_create_frame_buffer(ushort width, ushort height, TextureFormat format, TextureFlags flags);
开发者ID:prepare,项目名称:SharpBgfx,代码行数:1,代码来源:NativeMethods.cs


示例9: bgfx_create_texture_cube

 public static extern ushort bgfx_create_texture_cube(ushort size, byte numMips, TextureFormat format, TextureFlags flags, MemoryBlock.DataPtr* mem);
开发者ID:prepare,项目名称:SharpBgfx,代码行数:1,代码来源:NativeMethods.cs


示例10: bgfx_create_texture_2d_scaled

 public static extern ushort bgfx_create_texture_2d_scaled(BackbufferRatio ratio, byte numMips, TextureFormat format, TextureFlags flags);
开发者ID:prepare,项目名称:SharpBgfx,代码行数:1,代码来源:NativeMethods.cs


示例11: MyTextureCube

 /// <summary>
 /// Initializes a new instance of the <see cref="MyTexture2D"/> class.
 /// </summary>
 /// <param name="path">The path.</param>
 /// <param name="manager">The manager.</param>
 /// <param name="loadMethod">if set to <c>true</c> [external load].</param>
 /// <param name="flags">The flags.</param>
 public MyTextureCube(string path, LoadMethod loadMethod, TextureFlags flags)
     : base(path, loadMethod, flags)
 {
 }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:11,代码来源:MyTextureCube.cs


示例12: NewCube

 /// <summary>
 /// Creates a new Cube <see cref="TextureDescription"/>.
 /// </summary>
 /// <param name="size">The size (in pixels) of the top-level faces of the cube texture.</param>
 /// <param name="mipCount">Number of mipmaps, set to true to have all mipmaps, set to an int &gt;=1 for a particular mipmap count.</param>
 /// <param name="format">Describes the format to use.</param>
 /// <param name="textureFlags">The texture flags.</param>
 /// <param name="usage">The usage.</param>
 /// <returns>A new instance of <see cref="TextureDescription"/> class.</returns>
 public static TextureDescription NewCube(int size, MipMapCount mipCount, PixelFormat format, TextureFlags textureFlags = TextureFlags.ShaderResource, GraphicsResourceUsage usage = GraphicsResourceUsage.Default)
 {
     return NewCube(size, format, textureFlags, mipCount, usage);
 }
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:13,代码来源:TextureDescription.ExtensionsCube.cs


示例13: CreateDescription

        internal static Texture2DDescription CreateDescription(GraphicsDevice device, int width, int height, PixelFormat format, TextureFlags textureFlags, int mipCount, int arraySize, MSAALevel multiSampleCount)
        {
            // Make sure that the texture to create is a render target
            textureFlags |= TextureFlags.RenderTarget;
            var desc = Texture2DBase.NewDescription(width, height, format, textureFlags, mipCount, arraySize, ResourceUsage.Default);

            // Sets the MSAALevel
            int maximumMSAA = (int)device.Features[format].MSAALevelMax;
            desc.SampleDescription.Count = Math.Max(1, Math.Min((int)multiSampleCount, maximumMSAA));
            return desc;
        }
开发者ID:pH200,项目名称:SharpDX,代码行数:11,代码来源:RenderTarget2D.cs


示例14: NewDescription

        protected static Texture1DDescription NewDescription(int width, PixelFormat format, TextureFlags textureFlags, int mipCount, int arraySize, ResourceUsage usage)
        {
            if ((textureFlags & TextureFlags.UnorderedAccess) != 0)
                usage = ResourceUsage.Default;

            var desc = new Texture1DDescription()
                           {
                               Width = width,
                               ArraySize = arraySize,
                               BindFlags = GetBindFlagsFromTextureFlags(textureFlags),
                               Format = format,
                               MipLevels = CalculateMipMapCount(mipCount, width),
                               Usage = usage,
                               CpuAccessFlags = GetCputAccessFlagsFromUsage(usage),
                               OptionFlags = ResourceOptionFlags.None
                           };

            // If the texture is a RenderTarget + ShaderResource + MipLevels > 1, then allow for GenerateMipMaps method
            if ((desc.BindFlags & BindFlags.RenderTarget) != 0 && (desc.BindFlags & BindFlags.ShaderResource) != 0 && desc.MipLevels > 1)
            {
                desc.OptionFlags |= ResourceOptionFlags.GenerateMipMaps;
            }

            return desc;
        }
开发者ID:pH200,项目名称:SharpDX,代码行数:25,代码来源:Texture1DBase.cs


示例15: MyTexture2D

 /// <summary>
 /// Initializes a new instance of the <see cref="MyTexture2D"/> class.
 /// </summary>
 /// <param name="path">The path.</param>
 /// <param name="manager">The manager.</param>
 /// <param name="loadMethod">if set to <c>true</c> [external load].</param>
 /// <param name="flags">The flags.</param>
 public MyTexture2D(string contentDir, string path, LoadMethod loadMethod, TextureFlags flags)
     : base(contentDir, path, loadMethod, flags)
 {
 }
开发者ID:ChristianHeinz71,项目名称:SpaceEngineers,代码行数:11,代码来源:MyTexture2D.cs


示例16: bgfx_create_texture

 public static extern ushort bgfx_create_texture(MemoryBlock.DataPtr* mem, TextureFlags flags, byte skip, out Texture.TextureInfo info);
开发者ID:prepare,项目名称:SharpBgfx,代码行数:1,代码来源:NativeMethods.cs


示例17: NewRenderTargetDescription

 protected static Texture1DDescription NewRenderTargetDescription(int width, PixelFormat format, TextureFlags textureFlags,int mipCount, int arraySize)
 {
     var desc = Texture1DBase.NewDescription(width, format, textureFlags, mipCount, arraySize, ResourceUsage.Default);
     return desc;
 }
开发者ID:Ziriax,项目名称:SharpDX,代码行数:5,代码来源:RenderTarget1D.cs


示例18: bgfx_create_texture_3d

 public static extern ushort bgfx_create_texture_3d(ushort width, ushort _height, ushort _depth, byte numMips, TextureFormat format, TextureFlags flags, MemoryBlock.DataPtr* mem);
开发者ID:prepare,项目名称:SharpBgfx,代码行数:1,代码来源:NativeMethods.cs


示例19: New

 /// <summary>
 /// Creates a new <see cref="RenderTarget3D" /> with a single mipmap.
 /// </summary>
 /// <param name="device">The <see cref="GraphicsDevice"/>.</param>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 /// <param name="depth">The depth.</param>
 /// <param name="format">Describes the format to use.</param>
 /// <param name="flags">Sets the texture flags (for unordered access...etc.)</param>
 /// <param name="arraySize">Size of the texture 3D array, default to 1.</param>
 /// <returns>A new instance of <see cref="RenderTarget3D" /> class.</returns>
 /// <msdn-id>ff476521</msdn-id>
 ///   <unmanaged>HRESULT ID3D11Device::CreateTexture3D([In] const D3D11_TEXTURE3D_DESC* pDesc,[In, Buffer, Optional] const D3D11_SUBRESOURCE_DATA* pInitialData,[Out, Fast] ID3D11Texture3D** ppTexture3D)</unmanaged>
 ///   <unmanaged-short>ID3D11Device::CreateTexture3D</unmanaged-short>
 public static RenderTarget3D New(GraphicsDevice device, int width, int height, int depth,  PixelFormat format, TextureFlags flags = TextureFlags.RenderTarget | TextureFlags.ShaderResource, int arraySize = 1)
 {
     return New(device, width, height, depth, false, format, flags | TextureFlags.RenderTarget, arraySize);
 }
开发者ID:nikolaiklimov,项目名称:SharpDX,代码行数:18,代码来源:RenderTarget3D.cs


示例20: bgfx_override_internal_texture

 public static extern IntPtr bgfx_override_internal_texture(ushort handle, ushort width, ushort height, byte numMips, TextureFormat format, TextureFlags flags);
开发者ID:prepare,项目名称:SharpBgfx,代码行数:1,代码来源:NativeMethods.cs



注:本文中的TextureFlags类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TextureFormat类代码示例发布时间:2022-05-24
下一篇:
C# TextureCube类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap