Class RuntimeProfileDetector
- Namespace
- ShadowDusk.Core
- Assembly
- ShadowDusk.Core.dll
The runtime-detection advisory (Phase 35 auto-select seam 6): given a consumer's loaded XNA framework assembly, recommend the CapabilityProfile to compile for. This is the "auto-detect the runtime, give the newest proven experience" helper the consumer's game calls; the resulting profile is passed to Profile.
public static class RuntimeProfileDetector
- Inheritance
-
RuntimeProfileDetector
- Inherited Members
Remarks
Pure and XNA-free: it classifies by assembly name (reflection only), so ShadowDusk keeps no MonoGame/KNI/FNA reference. The recommendation is conservative by design: it returns the universally-loadable MGFX v10 contract (or fx_2_0 for FNA) for every runtime today. The newer containers (MGFX v11 on MonoGame 3.8.5, KNIFX on KNI 4.02) are render-proven but not yet auto-selected -- 3.8.5 is pre-release and KNIFX feature-parity (optimized matrices) is pending a KNIFXC golden -- so they stay opt-in via Profile until promoted here. Auto-detect only ever returns a profile already proven for the detected runtime; it never silently upgrades a consumer to an unproven format.
To promote a newer container to auto-selection (a deliberate version event), change the single Recommend(DetectedRuntime, PlatformTarget) mapping below, e.g. KNI -> KniGL_4_02 once KNIFX parity is render-proven.
Methods
Classify(string?)
Classifies the runtime from its XNA framework assembly simple name. All three reimplementations
share the Microsoft.Xna.Framework namespace, so the assembly name is the discriminator.
public static DetectedRuntime Classify(string? xnaAssemblySimpleName)
Parameters
xnaAssemblySimpleNamestring
Returns
Recommend(DetectedRuntime, PlatformTarget)
Recommends the proven CapabilityProfile to compile for the detected runtime and
graphics target. Conservative: see the type remarks.
public static CapabilityProfile Recommend(DetectedRuntime runtime, PlatformTarget target)
Parameters
runtimeDetectedRuntimetargetPlatformTarget
Returns
Recommend(Assembly, PlatformTarget)
Recommends a profile by reflecting the simple name off a loaded XNA assembly, e.g.
RuntimeProfileDetector.Recommend(typeof(Game).Assembly, PlatformTarget.OpenGL).
public static CapabilityProfile Recommend(Assembly xnaAssembly, PlatformTarget target)
Parameters
xnaAssemblyAssemblytargetPlatformTarget
Returns
Recommend(string?, PlatformTarget)
Recommends a profile from the runtime assembly's simple name.
public static CapabilityProfile Recommend(string? xnaAssemblySimpleName, PlatformTarget target)
Parameters
xnaAssemblySimpleNamestringtargetPlatformTarget