initial refresh backend selection API support

pull/27/head
cosmonaut 2022-09-28 16:52:01 -07:00
parent 3ffdf8a929
commit 0034b24eff
4 changed files with 14 additions and 1 deletions

@ -1 +1 @@
Subproject commit 356f8e9ec2a6118b75e32d2a2ed7dbf4297aba78 Subproject commit eaed76f4dcc60022b3f10997fb34eb8ead9ae7d7

View File

@ -79,6 +79,7 @@ namespace MoonWorks
GraphicsDevice = new GraphicsDevice( GraphicsDevice = new GraphicsDevice(
Window.Handle, Window.Handle,
Backend.Vulkan,
moonWorksToRefreshPresentMode[presentMode], moonWorksToRefreshPresentMode[presentMode],
debugMode debugMode
); );

View File

@ -8,6 +8,7 @@ namespace MoonWorks.Graphics
public class GraphicsDevice : IDisposable public class GraphicsDevice : IDisposable
{ {
public IntPtr Handle { get; } public IntPtr Handle { get; }
public Backend Backend { get; }
// Built-in video pipeline // Built-in video pipeline
private ShaderModule VideoVertexShader { get; } private ShaderModule VideoVertexShader { get; }
@ -20,10 +21,13 @@ namespace MoonWorks.Graphics
public GraphicsDevice( public GraphicsDevice(
IntPtr deviceWindowHandle, IntPtr deviceWindowHandle,
Backend preferredBackend,
Refresh.PresentMode presentMode, Refresh.PresentMode presentMode,
bool debugMode bool debugMode
) )
{ {
Backend = (Backend) Refresh.Refresh_SelectBackend((Refresh.Backend) preferredBackend, out uint flags);
var presentationParameters = new Refresh.PresentationParameters var presentationParameters = new Refresh.PresentationParameters
{ {
deviceWindowHandle = deviceWindowHandle, deviceWindowHandle = deviceWindowHandle,

View File

@ -280,4 +280,12 @@ namespace MoonWorks.Graphics
FloatOpaqueWhite, FloatOpaqueWhite,
IntOpaqueWhite IntOpaqueWhite
} }
public enum Backend
{
DontCare,
Vulkan,
PS5,
Invalid
}
} }