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)); }
public void SetData(ref TextureSlice textureSlice, IntPtr data, uint dataLengthInBytes) { var refreshTextureSlice = textureSlice.ToRefreshTextureSlice(); Refresh.Refresh_SetTextureData( Device.Handle, ref refreshTextureSlice, data, dataLengthInBytes ); }
public void CopyTextureToBuffer( ref TextureSlice textureSlice, Buffer buffer ) { var refreshTextureSlice = textureSlice.ToRefreshTextureSlice(); Refresh.Refresh_CopyTextureToBuffer( Device.Handle, Handle, ref refreshTextureSlice, buffer.Handle ); }
public void QueuePresent( ref TextureSlice textureSlice, Refresh.Filter filter ) { var refreshTextureSlice = textureSlice.ToRefreshTextureSlice(); Refresh.Refresh_QueuePresent( Device.Handle, Handle, ref refreshTextureSlice, IntPtr.Zero, filter ); }
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 ); }
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 ); }
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); }