Add managed render pipeline selection bridge
This commit is contained in:
34
managed/XCEngine.ScriptCore/GraphicsSettings.cs
Normal file
34
managed/XCEngine.ScriptCore/GraphicsSettings.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
|
||||
namespace XCEngine
|
||||
{
|
||||
public static class GraphicsSettings
|
||||
{
|
||||
public static Type renderPipelineAssetType
|
||||
{
|
||||
get
|
||||
{
|
||||
string assemblyQualifiedName =
|
||||
InternalCalls.Rendering_GetRenderPipelineAssetTypeName();
|
||||
if (string.IsNullOrEmpty(assemblyQualifiedName))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return Type.GetType(assemblyQualifiedName, throwOnError: false);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != null &&
|
||||
!typeof(RenderPipelineAsset).IsAssignableFrom(value))
|
||||
{
|
||||
throw new ArgumentException(
|
||||
"GraphicsSettings.renderPipelineAssetType must derive from RenderPipelineAsset.",
|
||||
nameof(value));
|
||||
}
|
||||
|
||||
InternalCalls.Rendering_SetRenderPipelineAssetType(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user