コード例 #1
0
		public static Texture2D.Texture2DSubresource[] CreateMipMaps(int mipLevels, int width, int height)
		{
			var result = new Texture2D.Texture2DSubresource[mipLevels];
			for (int level = 0; level < mipLevels; level++)
			{
				result[level] = new Texture2D.Texture2DSubresource(width, height);

				width = System.Math.Max((int) System.Math.Floor(width / 2.0), 1);
                height = System.Math.Max((int) System.Math.Floor(height / 2.0), 1);
			}
			return result;
		}
コード例 #2
0
        public static Texture2D.Texture2DSubresource[] CreateMipMaps(int mipLevels, int width, int height)
        {
            var result = new Texture2D.Texture2DSubresource[mipLevels];

            for (int level = 0; level < mipLevels; level++)
            {
                result[level] = new Texture2D.Texture2DSubresource(width, height);

                width  = System.Math.Max((int)System.Math.Floor(width / 2.0), 1);
                height = System.Math.Max((int)System.Math.Floor(height / 2.0), 1);
            }
            return(result);
        }
コード例 #3
0
			public Texture2DView(Texture2D resource, RenderTargetViewDescription.Texture2DResource description)
			{
				_subresource = resource.GetSubresource(0, description.MipSlice);
			}
コード例 #4
0
			public Texture2DView(Texture2D resource, DepthStencilViewDescription.Texture2DResource description)
			{
				_subresource = resource.GetSubresource(0, description.MipSlice);
			}