Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More iOS fixes #208

Merged
merged 15 commits into from
Nov 5, 2018
Merged
1 change: 1 addition & 0 deletions FNA.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@
<Compile Include="src\Utilities\AssemblyHelper.cs" />
<Compile Include="src\Utilities\FileHelpers.cs" />
<Compile Include="src\Utilities\FNAInternalExtensions.cs" />
<Compile Include="src\Utilities\XamarinHelper.cs" />
<Compile Include="src\Vector2.cs" />
<Compile Include="src\Vector3.cs" />
<Compile Include="src\Vector4.cs" />
Expand Down
1 change: 1 addition & 0 deletions FNA.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@
<Compile Include="src\Utilities\AssemblyHelper.cs" />
<Compile Include="src\Utilities\FileHelpers.cs" />
<Compile Include="src\Utilities\FNAInternalExtensions.cs" />
<Compile Include="src\Utilities\XamarinHelper.cs" />
<Compile Include="src\Vector2.cs" />
<Compile Include="src\Vector3.cs" />
<Compile Include="src\Vector4.cs" />
Expand Down
6 changes: 6 additions & 0 deletions FNA.dll.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,10 @@
<dllmap dll="SDL2_image" os="osx" target="libSDL2_image-2.0.0.dylib"/>
<dllmap dll="SDL2_image" os="linux,freebsd,netbsd" target="libSDL2_image-2.0.so.0"/>
<dllmap dll="SDL2_image" os="openbsd" target="libSDL2_image.so.0"/>

<dllmap dll="SDL2" os="osx" cpu="armv8" target="__Internal"/>
<dllmap dll="SDL2_image" os="osx" cpu="armv8" target="__Internal"/>
<dllmap dll="mojoshader" os="osx" cpu="armv8" target="__Internal"/>
<dllmap dll="FAudio" os="osx" cpu="armv8" target="__Internal"/>
<dllmap dll="libtheorafile" os="osx" cpu="armv8" target="__Internal"/>
</configuration>
2 changes: 2 additions & 0 deletions src/FNAPlatform/OpenGLDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ public VertexAttribute()

private bool effectApplied = false;

[ObjCRuntime.MonoPInvokeCallback(typeof(MojoShader.MOJOSHADER_glGetProcAddress))]
private static IntPtr glGetProcAddress(IntPtr name, IntPtr d)
{
return SDL.SDL_GL_GetProcAddress(name);
Expand Down Expand Up @@ -607,6 +608,7 @@ GraphicsAdapter adapter

// UIKit needs special treatment for backbuffer behavior
SDL.SDL_SysWMinfo wmInfo = new SDL.SDL_SysWMinfo();
SDL.SDL_VERSION(out wmInfo.version);
SDL.SDL_GetWindowWMInfo(
presentationParameters.DeviceWindowHandle,
ref wmInfo
Expand Down
2 changes: 1 addition & 1 deletion src/FrameworkDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;
TheSpydog marked this conversation as resolved.
Show resolved Hide resolved
using MediaPlayer = Microsoft.Xna.Framework.Media.MediaPlayer;
#endregion

namespace Microsoft.Xna.Framework
Expand Down
25 changes: 25 additions & 0 deletions src/Utilities/XamarinHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#region License
/* FNA - XNA4 Reimplementation for Desktop Platforms
* Copyright 2009-2018 Ethan Lee and the MonoGame Team
*
* Released under the Microsoft Public License.
* See LICENSE for details.
*/
#endregion

#region Using Statements
using System;
#endregion

// This is a dummy namespace needed for Xamarin iOS/tvOS AOT compilation
namespace ObjCRuntime
{
[AttributeUsage(AttributeTargets.Method)]
class MonoPInvokeCallbackAttribute : Attribute
{
public MonoPInvokeCallbackAttribute(Type t)
{

}
}
}