Skip to content

Commit

Permalink
Add compile time exclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
kaltinril committed Nov 18, 2024
1 parent 8b02498 commit 5f74981
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/MonoGame.Extended/Content/ContentReaderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ namespace MonoGame.Extended.Content
{
public static class ContentReaderExtensions
{
#if FNA || KNI
private static readonly FieldInfo _contentReaderGraphicsDeviceFieldInfo = typeof(ContentReader).GetTypeInfo().GetDeclaredField("graphicsDevice");

public static GraphicsDevice GetGraphicsDevice(this ContentReader contentReader)
{
return (GraphicsDevice)_contentReaderGraphicsDeviceFieldInfo.GetValue(contentReader);
}
#endif

public static string RemoveExtension(string path)
{
Expand Down

0 comments on commit 5f74981

Please sign in to comment.