forked from MoonsideGames/MoonWorks
Clear and AcquireSwapchainTexture ABI break
parent
8f9aaf6d61
commit
2a9286f31e
|
@ -1 +1 @@
|
||||||
Subproject commit 848db820a6de3437f44e8e45f4c274f40bbfae27
|
Subproject commit 237c3aebb6cfe0ec11f6de6134a07bac4735ede8
|
|
@ -541,44 +541,6 @@ namespace MoonWorks.Graphics
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Clears the render targets on the current framebuffer to a single color or depth/stencil value.
|
|
||||||
/// NOTE: It is recommended that you clear when beginning render passes unless you have a good reason to clear mid-pass.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="clearRect">The area of the framebuffer to clear.</param>
|
|
||||||
/// <param name="clearOptions">Whether to clear colors, depth, or stencil value, or multiple.</param>
|
|
||||||
/// <param name="depthStencilClearValue">The depth/stencil clear values. Will be ignored if color is not provided in ClearOptions.</param>
|
|
||||||
/// <param name="clearColors">The color clear values. Must provide one per render target. Can be omitted if depth/stencil is not cleared.</param>
|
|
||||||
public unsafe void Clear(
|
|
||||||
in Rect clearRect,
|
|
||||||
ClearOptionsFlags clearOptions,
|
|
||||||
in DepthStencilValue depthStencilClearValue,
|
|
||||||
params Vector4[] clearColors
|
|
||||||
)
|
|
||||||
{
|
|
||||||
Refresh.Vec4* colors = stackalloc Refresh.Vec4[clearColors.Length];
|
|
||||||
for (var i = 0; i < clearColors.Length; i++)
|
|
||||||
{
|
|
||||||
colors[i] = new Refresh.Vec4
|
|
||||||
{
|
|
||||||
x = clearColors[i].X,
|
|
||||||
y = clearColors[i].Y,
|
|
||||||
z = clearColors[i].Z,
|
|
||||||
w = clearColors[i].W
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
Refresh.Refresh_Clear(
|
|
||||||
Device.Handle,
|
|
||||||
Handle,
|
|
||||||
clearRect.ToRefresh(),
|
|
||||||
(Refresh.ClearOptionsFlags) clearOptions,
|
|
||||||
(IntPtr) colors,
|
|
||||||
(uint) clearColors.Length,
|
|
||||||
depthStencilClearValue.ToRefresh()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Draws using instanced rendering.
|
/// Draws using instanced rendering.
|
||||||
/// It is an error to call this method unless two vertex buffers have been bound.
|
/// It is an error to call this method unless two vertex buffers have been bound.
|
||||||
|
@ -687,7 +649,9 @@ namespace MoonWorks.Graphics
|
||||||
var texturePtr = Refresh.Refresh_AcquireSwapchainTexture(
|
var texturePtr = Refresh.Refresh_AcquireSwapchainTexture(
|
||||||
Device.Handle,
|
Device.Handle,
|
||||||
Handle,
|
Handle,
|
||||||
window.Handle
|
window.Handle,
|
||||||
|
out var width,
|
||||||
|
out var height
|
||||||
);
|
);
|
||||||
|
|
||||||
if (texturePtr == IntPtr.Zero)
|
if (texturePtr == IntPtr.Zero)
|
||||||
|
@ -699,8 +663,8 @@ namespace MoonWorks.Graphics
|
||||||
Device,
|
Device,
|
||||||
texturePtr,
|
texturePtr,
|
||||||
Device.GetSwapchainFormat(window),
|
Device.GetSwapchainFormat(window),
|
||||||
window.Width,
|
width,
|
||||||
window.Height
|
height
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue