AcquireSwapchainTexture nullable
parent
ef10be4e9d
commit
d6606d90f6
|
@ -657,13 +657,24 @@ namespace MoonWorks.Graphics
|
||||||
/// Acquires a swapchain texture.
|
/// Acquires a swapchain texture.
|
||||||
/// This texture will be presented to the given window when the command buffer is submitted.
|
/// This texture will be presented to the given window when the command buffer is submitted.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Texture AcquireSwapchainTexture(
|
public Texture? AcquireSwapchainTexture(
|
||||||
Window window
|
Window window
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
var texturePtr = Refresh.Refresh_AcquireSwapchainTexture(
|
||||||
|
Device.Handle,
|
||||||
|
Handle,
|
||||||
|
window.Handle
|
||||||
|
);
|
||||||
|
|
||||||
|
if (texturePtr == IntPtr.Zero)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return new Texture(
|
return new Texture(
|
||||||
Device,
|
Device,
|
||||||
Refresh.Refresh_AcquireSwapchainTexture(Device.Handle, Handle, window.Handle),
|
texturePtr,
|
||||||
Device.GetSwapchainFormat(window),
|
Device.GetSwapchainFormat(window),
|
||||||
window.Width,
|
window.Width,
|
||||||
window.Height
|
window.Height
|
||||||
|
|
Loading…
Reference in New Issue