コード例 #1
0
        public Cubemap(int width, GraphicsFormat format, TextureCreationFlags flags, int mipCount)
        {
            bool flag = !base.ValidateFormat(format, FormatUsage.Sample);

            if (!flag)
            {
                Cubemap.ValidateIsNotCrunched(flags);
                Cubemap.Internal_Create(this, width, mipCount, format, flags, IntPtr.Zero);
            }
        }
コード例 #2
0
        internal Cubemap(int width, TextureFormat textureFormat, int mipCount, IntPtr nativeTex)
        {
            bool flag = !base.ValidateFormat(textureFormat);

            if (!flag)
            {
                GraphicsFormat       graphicsFormat       = GraphicsFormatUtility.GetGraphicsFormat(textureFormat, false);
                TextureCreationFlags textureCreationFlags = (mipCount != 1) ? TextureCreationFlags.MipChain : TextureCreationFlags.None;
                bool flag2 = GraphicsFormatUtility.IsCrunchFormat(textureFormat);
                if (flag2)
                {
                    textureCreationFlags |= TextureCreationFlags.Crunch;
                }
                Cubemap.ValidateIsNotCrunched(textureCreationFlags);
                Cubemap.Internal_Create(this, width, mipCount, graphicsFormat, textureCreationFlags, nativeTex);
            }
        }