コード例 #1
0
ファイル: ColorTarget.cs プロジェクト: thatcosmonaut/Campari
        public static ColorTarget CreateBackedColorTarget2D(
            GraphicsDevice device,
            uint width,
            uint height,
            Refresh.ColorFormat format,
            bool canBeSampled,
            Refresh.SampleCount sampleCount = Refresh.SampleCount.One,
            uint levelCount = 1
            )
        {
            var flags = Refresh.TextureUsageFlags.ColorTargetBit;

            if (canBeSampled)
            {
                flags |= Refresh.TextureUsageFlags.SamplerBit;
            }

            var texture = Texture.CreateTexture2D(
                device,
                width,
                height,
                format,
                flags,
                sampleCount,
                levelCount
                );

            var textureSlice = new TextureSlice(texture);

            return(new ColorTarget(device, sampleCount, ref textureSlice));
        }
コード例 #2
0
ファイル: Texture.cs プロジェクト: thatcosmonaut/Campari
        public void SetData(ref TextureSlice textureSlice, IntPtr data, uint dataLengthInBytes)
        {
            var refreshTextureSlice = textureSlice.ToRefreshTextureSlice();

            Refresh.Refresh_SetTextureData(
                Device.Handle,
                ref refreshTextureSlice,
                data,
                dataLengthInBytes
                );
        }
コード例 #3
0
        public void CopyTextureToBuffer(
            ref TextureSlice textureSlice,
            Buffer buffer
            )
        {
            var refreshTextureSlice = textureSlice.ToRefreshTextureSlice();

            Refresh.Refresh_CopyTextureToBuffer(
                Device.Handle,
                Handle,
                ref refreshTextureSlice,
                buffer.Handle
                );
        }
コード例 #4
0
        public void QueuePresent(
            ref TextureSlice textureSlice,
            Refresh.Filter filter
            )
        {
            var refreshTextureSlice = textureSlice.ToRefreshTextureSlice();

            Refresh.Refresh_QueuePresent(
                Device.Handle,
                Handle,
                ref refreshTextureSlice,
                IntPtr.Zero,
                filter
                );
        }
コード例 #5
0
        public void QueuePresent(
            ref TextureSlice textureSlice,
            ref Refresh.Rect destinationRectangle,
            Refresh.Filter filter
            )
        {
            var refreshTextureSlice = textureSlice.ToRefreshTextureSlice();

            Refresh.Refresh_QueuePresent(
                Device.Handle,
                Handle,
                ref refreshTextureSlice,
                ref destinationRectangle,
                filter
                );
        }
コード例 #6
0
        public void CopyTextureToTexture(
            ref TextureSlice sourceTextureSlice,
            ref TextureSlice destinationTextureSlice,
            Refresh.Filter filter
            )
        {
            var sourceRefreshTextureSlice = sourceTextureSlice.ToRefreshTextureSlice();
            var destRefreshTextureSlice   = destinationTextureSlice.ToRefreshTextureSlice();

            Refresh.Refresh_CopyTextureToTexture(
                Device.Handle,
                Handle,
                ref sourceRefreshTextureSlice,
                ref destRefreshTextureSlice,
                filter
                );
        }
コード例 #7
0
ファイル: ColorTarget.cs プロジェクト: thatcosmonaut/Campari
        public ColorTarget(GraphicsDevice device, Refresh.SampleCount sampleCount, ref TextureSlice textureSlice) : base(device)
        {
            var refreshTextureSlice = textureSlice.ToRefreshTextureSlice();

            Handle = Refresh.Refresh_CreateColorTarget(device.Handle, sampleCount, ref refreshTextureSlice);
        }