Support OpenTK on Tizen platform
authoran87.li <an87.li@samsung.com>
Mon, 20 Nov 2017 08:08:18 +0000 (16:08 +0800)
committeran87.li <an87.li@samsung.com>
Mon, 20 Nov 2017 08:21:16 +0000 (16:21 +0800)
1. Add new project files for Tizen
2. Add condition compilation TIZEN in AL/ES11/ES20/EGL/SDL2 for finding right library name on Tizen
3. Add condition compilation TIZEN for Sdl2 and Sdl2NativeWindow initialize on Tizen

src/OpenTK/Audio/OpenAL/AL/AL.cs [changed mode: 0644->0755]
src/OpenTK/Configuration.cs [changed mode: 0644->0755]
src/OpenTK/Graphics/ES11/Helper.cs [changed mode: 0644->0755]
src/OpenTK/Graphics/ES20/Helper.cs [changed mode: 0644->0755]
src/OpenTK/OpenTK.Tizen.csproj [new file with mode: 0755]
src/OpenTK/OpenTK.Tizen.csproj.paket.template [new file with mode: 0755]
src/OpenTK/Platform/Egl/Egl.cs [changed mode: 0644->0755]
src/OpenTK/Platform/SDL2/Sdl2.cs [changed mode: 0644->0755]
src/OpenTK/Platform/SDL2/Sdl2NativeWindow.cs [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index b00dc2c..9fc1bad
@@ -66,8 +66,12 @@ namespace OpenTK.Audio.OpenAL
     /// </summary>
     public static partial class AL
     {
-
+        #if TIZEN
+        internal const string Lib = "libopenal.so.1.17.2";
+        #else
         internal const string Lib = "openal32.dll";
+        #endif
+
         private const CallingConvention Style = CallingConvention.Cdecl;
 
         /// <summary>This function enables a feature of the OpenAL driver. There are no capabilities defined in OpenAL 1.1 to be used with this function, but it may be used by an extension.</summary>
old mode 100644 (file)
new mode 100755 (executable)
index 8fedf6a..180c499
@@ -188,6 +188,10 @@ namespace OpenTK
                     else
                     {
                         // Attempt to initialize SDL2.
+                        #if TIZEN
+                        Platform.SDL2.SDL.SetMainReady();
+                        #endif
+
                         var flags =
                             Platform.SDL2.SystemFlags.VIDEO |
                             Platform.SDL2.SystemFlags.TIMER;
old mode 100644 (file)
new mode 100755 (executable)
index 748d4d5..42bf943
@@ -10,6 +10,8 @@ namespace OpenTK.Graphics.ES11
     {
 #if IPHONE
         private const string Library = "/System/Library/Frameworks/OpenGLES.framework/OpenGLES";
+#elif TIZEN
+        private const string Library = "libGLESv1_CM.so.1";
 #else
         private const string Library = "GLESv1_CM";
 #endif
old mode 100644 (file)
new mode 100755 (executable)
index 5990517..e889f9c
@@ -39,6 +39,8 @@ namespace OpenTK.Graphics.ES20
     {
 #if IPHONE
         private const string Library = "/System/Library/Frameworks/OpenGLES.framework/OpenGLES";
+#elif TIZEN
+        private const string Library = "libGLESv2.so.2";
 #else
         private const string Library = "libGLESv2.dll";
 #endif
diff --git a/src/OpenTK/OpenTK.Tizen.csproj b/src/OpenTK/OpenTK.Tizen.csproj
new file mode 100755 (executable)
index 0000000..0e980bb
--- /dev/null
@@ -0,0 +1,388 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{A37A7E14-0000-0000-0000-000000000000}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <RootNamespace>OpenTK</RootNamespace>
+    <AssemblyKeyContainerName>
+    </AssemblyKeyContainerName>
+    <AssemblyName>OpenTK</AssemblyName>
+    <DefaultClientScript>JScript</DefaultClientScript>
+    <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
+    <DefaultTargetSchema>IE50</DefaultTargetSchema>
+    <DelaySign>false</DelaySign>
+    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+    <Deterministic>true</Deterministic>
+    <RunCodeAnalysis>true</RunCodeAnalysis>
+    <CodeAnalysisRuleSet>..\..\stylecop.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <BaseAddress>285212672</BaseAddress>
+    <DefineConstants>DEBUG;TRACE;TIZEN;SDL2;OPENGLES</DefineConstants>
+    <DocumentationFile>bin\Debug\Tizen\OpenTK.xml</DocumentationFile>
+    <FileAlignment>4096</FileAlignment>
+    <Optimize>False</Optimize>
+    <OutputPath>bin\Debug\Tizen\</OutputPath>
+    <RegisterForComInterop>False</RegisterForComInterop>
+    <RemoveIntegerChecks>False</RemoveIntegerChecks>
+    <WarningLevel>4</WarningLevel>
+    <DebugSymbols>True</DebugSymbols>
+    <DebugType>full</DebugType>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <BaseAddress>285212672</BaseAddress>
+    <DefineConstants>TRACE;TIZEN;SDL2;OPENGLES</DefineConstants>
+    <DocumentationFile>bin\Release\Tizen\OpenTK.xml</DocumentationFile>
+    <FileAlignment>4096</FileAlignment>
+    <Optimize>True</Optimize>
+    <OutputPath>bin\Release\Tizen\</OutputPath>
+    <RegisterForComInterop>False</RegisterForComInterop>
+    <RemoveIntegerChecks>False</RemoveIntegerChecks>
+    <WarningLevel>4</WarningLevel>
+    <DebugSymbols>True</DebugSymbols>
+    <DebugType>pdbonly</DebugType>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>True</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>..\..\OpenTK.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System">
+      <Name>System</Name>
+    </Reference>
+    <Reference Include="System.Data">
+      <Name>System.Data</Name>
+    </Reference>
+    <Reference Include="System.Drawing" Condition=" '$(Configuration)' != 'DebugMinimal' And '$(Configuration)' != 'ReleaseMinimal' ">
+      <Name>System.Drawing</Name>
+    </Reference>
+    <Reference Include="System.Xml">
+      <Name>System.Xml</Name>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="DisplayDevice.cs" />
+    <Compile Include="DisplayIndex.cs" />
+       <Compile Include="ToolkitOptions.cs" />
+    <Compile Include="WindowBorder.cs" />
+    <Compile Include="ContextHandle.cs" />
+    <Compile Include="WindowState.cs" />
+    <Compile Include="IGameWindow.cs" />
+    <Compile Include="GameWindowFlags.cs" />
+    <Compile Include="KeyPressEventArgs.cs" />
+    <Compile Include="AutoGeneratedAttribute.cs" />
+    <Compile Include="CountAttribute.cs" />
+    <Compile Include="NativeWindow.cs" />
+    <Compile Include="DisplayResolution.cs" />
+    <Compile Include="BindingsBase.cs" />
+    <Compile Include="Toolkit.cs" />
+    <Compile Include="FrameEventArgs.cs" />
+    <Compile Include="BlittableValueType.cs" />
+    <Compile Include="GameWindow.cs" />
+    <Compile Include="Minimal.cs" />
+    <Compile Include="Configuration.cs" />
+    <Compile Include="Exceptions.cs" />
+    <Compile Include="INativeWindow.cs" />
+    <Compile Include="InteropHelper.cs" />
+    <Compile Include="IntPtrEqualityComparer.cs" />
+    <Compile Include="SlotAttribute.cs" />
+    <Compile Include="RewrittenAttribute.cs" />
+    <Compile Include="Platform\PlatformFactoryBase.cs" />
+    <Compile Include="MouseCursor.cs" />
+    <Compile Include="WindowIcon.cs" />
+
+    <Compile Include="Audio\AudioDeviceException.cs" />
+    <Compile Include="Audio\AudioContextException.cs" />
+    <Compile Include="Audio\AudioValueException.cs" />
+    <Compile Include="Audio\AudioException.cs" />
+    <Compile Include="Audio\AudioDeviceEnumerator.cs" />
+    <Compile Include="Audio\AudioDeviceErrorChecker.cs" />
+    <Compile Include="Audio\AudioContext.cs" />
+    <Compile Include="Audio\AudioCapture.cs" />
+    <Compile Include="Audio\OpenAL\Alc\AlcEnums.cs" />
+    <Compile Include="Audio\OpenAL\Alc\Alc.cs" />
+    <Compile Include="Audio\OpenAL\AL\EffectsExtensionPresets.cs" />
+    <Compile Include="Audio\OpenAL\AL\EffectsExtensionEnums.cs" />
+    <Compile Include="Audio\OpenAL\AL\XRamExtension.cs" />
+    <Compile Include="Audio\OpenAL\AL\EffectsExtension.cs" />
+    <Compile Include="Audio\OpenAL\AL\AL.cs" />
+    <Compile Include="Audio\OpenAL\AL\ALEnums.cs" />
+    <Compile Include="Compute\Memory.cs" />
+    <Compile Include="Compute\Device.cs" />
+    <Compile Include="Compute\Platform.cs" />
+    <Compile Include="Compute\Sampler.cs" />
+    <Compile Include="Compute\Kernel.cs" />
+    <Compile Include="Compute\Profiler.cs" />
+    <Compile Include="Compute\Program.cs" />
+    <Compile Include="Compute\Enums.cs" />
+    <Compile Include="Compute\CommandQueue.cs" />
+    <Compile Include="Compute\CLHelper.cs" />
+    <Compile Include="Compute\Event.cs" />
+    <Compile Include="Compute\Structs.cs" />
+    <Compile Include="Compute\Configuration.cs" />
+    <Compile Include="Compute\ComputeContext.cs" />
+    <Compile Include="Compute\CL10\Enums.cs" />
+    <Compile Include="Compute\CL10\ErrorHelper.cs" />
+    <Compile Include="Compute\CL10\Delegates.cs" />
+    <Compile Include="Compute\CL10\Core.cs" />
+    <Compile Include="Compute\CL10\CLHelper.cs" />
+    <Compile Include="Compute\CL10\CL.cs" />
+    <Compile Include="Compute\CL10\ImageFormat.cs" />
+    <Compile Include="Graphics\Color4.cs" />
+    <Compile Include="Graphics\ColorFormat.cs" />
+    <Compile Include="Graphics\ES10\Core.cs" />
+    <Compile Include="Graphics\ES10\Enums.cs" />
+    <Compile Include="Graphics\ES10\ErrorHelper.cs" />
+    <Compile Include="Graphics\ES10\ES.cs" />
+    <Compile Include="Graphics\ES10\Helper.cs" />
+    <Compile Include="Graphics\ES11\ES11.cs" />
+    <Compile Include="Graphics\ES11\ES11Enums.cs" />
+    <Compile Include="Graphics\ES11\ES11Obsolete.cs" />
+    <Compile Include="Graphics\ES11\ErrorHelper.cs" />
+    <Compile Include="Graphics\ES11\Helper.cs" />
+    <Compile Include="Graphics\ES20\ES20.cs" />
+    <Compile Include="Graphics\ES20\ES20Enums.cs" />
+    <Compile Include="Graphics\ES20\ErrorHelper.cs" />
+    <Compile Include="Graphics\ES20\Helper.cs" />
+    <Compile Include="Graphics\ES30\ES30.cs" />
+    <Compile Include="Graphics\ES30\ES30Enums.cs" />
+    <Compile Include="Graphics\ES30\ErrorHelper.cs" />
+    <Compile Include="Graphics\ES30\Helper.cs" />
+    <Compile Include="Graphics\GraphicsBindingsBase.cs" />
+    <Compile Include="Graphics\GraphicsContext.cs" />
+    <Compile Include="Graphics\GraphicsContextBase.cs" />
+    <Compile Include="Graphics\GraphicsContextException.cs" />
+    <Compile Include="Graphics\GraphicsContextFlags.cs" />
+    <Compile Include="Graphics\GraphicsContextMissingException.cs" />
+    <Compile Include="Graphics\GraphicsContextVersion.cs" />
+    <Compile Include="Graphics\GraphicsErrorException.cs" />
+    <Compile Include="Graphics\GraphicsExceptions.cs" />
+    <Compile Include="Graphics\GraphicsModeComparer.cs" />
+    <Compile Include="Graphics\GraphicsMode.cs" />
+    <Compile Include="Graphics\GraphicsModeException.cs" />
+    <Compile Include="Graphics\IGraphicsContext.cs" />
+    <Compile Include="Graphics\IGraphicsMode.cs" />
+    <Compile Include="Input\ButtonState.cs" />
+    <Compile Include="Input\Buttons.cs" />
+    <Compile Include="Input\ConfigurationType.cs" />
+    <Compile Include="Input\FileDropEventArgs.cs" />
+    <Compile Include="Input\GamePad.cs" />
+    <Compile Include="Input\GamePadAxes.cs" />
+    <Compile Include="Input\GamePadButtons.cs" />
+    <Compile Include="Input\GamePadCapabilities.cs" />
+    <Compile Include="Input\GamePadConfiguration.cs" />
+    <Compile Include="Input\GamePadConfigurationDatabase.cs" />
+    <Compile Include="Input\GamePadConfigurationItem.cs" />
+    <Compile Include="Input\GamePadConfigurationSource.cs" />
+    <Compile Include="Input\GamePadConfigurationTarget.cs" />
+    <Compile Include="Input\GamePadDPad.cs" />
+    <Compile Include="Input\GamePadState.cs" />
+    <Compile Include="Input\GamePadThumbSticks.cs" />
+    <Compile Include="Input\GamePadTriggers.cs" />
+    <Compile Include="Input\GamePadType.cs" />
+    <Compile Include="Input\HatPosition.cs" />
+    <Compile Include="Input\IGamePadDriver.cs" />
+    <Compile Include="Input\IInputDevice.cs" />
+    <Compile Include="Input\IInputDriver2.cs" />
+    <Compile Include="Input\IJoystickDriver2.cs" />
+    <Compile Include="Input\IKeyboardDriver2.cs" />
+    <Compile Include="Input\IMouseDriver2.cs" />
+    <Compile Include="Input\Joystick.cs" />
+    <Compile Include="Input\JoystickCapabilities.cs" />
+    <Compile Include="Input\JoystickDevice.cs" />
+    <Compile Include="Input\JoystickHat.cs" />
+    <Compile Include="Input\JoystickHatState.cs" />
+    <Compile Include="Input\JoystickState.cs" />
+    <Compile Include="Input\Key.cs" />
+    <Compile Include="Input\KeyModifiers.cs" />
+    <Compile Include="Input\Keyboard.cs" />
+    <Compile Include="Input\KeyboardDevice.cs" />
+    <Compile Include="Input\KeyboardKeyEventArgs.cs" />
+    <Compile Include="Input\KeyboardState.cs" />
+    <Compile Include="Input\Mouse.cs" />
+    <Compile Include="Input\MouseButton.cs" />
+    <Compile Include="Input\MouseDevice.cs" />
+    <Compile Include="Input\MouseEventArgs.cs" />
+    <Compile Include="Input\MouseScroll.cs" />
+    <Compile Include="Input\MouseState.cs" />
+    <Compile Include="Math\BezierCurve.cs" />
+    <Compile Include="Math\BezierCurveCubic.cs" />
+    <Compile Include="Math\BezierCurveQuadric.cs" />
+    <Compile Include="Math\Box2.cs" />
+    <Compile Include="Math\Box2d.cs" />
+    <Compile Include="Math\Half.cs" />
+    <Compile Include="Math\MathHelper.cs" />
+    <Compile Include="Math\Matrix2.cs" />
+    <Compile Include="Math\Matrix2d.cs" />
+    <Compile Include="Math\Matrix2x3.cs" />
+    <Compile Include="Math\Matrix2x3d.cs" />
+    <Compile Include="Math\Matrix2x4.cs" />
+    <Compile Include="Math\Matrix2x4d.cs" />
+    <Compile Include="Math\Matrix3.cs" />
+    <Compile Include="Math\Matrix3d.cs" />
+    <Compile Include="Math\Matrix3x2.cs" />
+    <Compile Include="Math\Matrix3x2d.cs" />
+    <Compile Include="Math\Matrix3x4.cs" />
+    <Compile Include="Math\Matrix3x4d.cs" />
+    <Compile Include="Math\Matrix4.cs" />
+    <Compile Include="Math\Matrix4d.cs" />
+    <Compile Include="Math\Matrix4x2.cs" />
+    <Compile Include="Math\Matrix4x2d.cs" />
+    <Compile Include="Math\Matrix4x3.cs" />
+    <Compile Include="Math\Matrix4x3d.cs" />
+    <Compile Include="Math\Point.cs" />
+    <Compile Include="Math\Quaternion.cs" />
+    <Compile Include="Math\Quaterniond.cs" />
+    <Compile Include="Math\Rectangle.cs" />
+    <Compile Include="Math\Size.cs" />
+    <Compile Include="Math\Vector2.cs" />
+    <Compile Include="Math\Vector2d.cs" />
+    <Compile Include="Math\Vector2h.cs" />
+    <Compile Include="Math\Vector3.cs" />
+    <Compile Include="Math\Vector3d.cs" />
+    <Compile Include="Math\Vector3h.cs" />
+    <Compile Include="Math\Vector4.cs" />
+    <Compile Include="Math\Vector4d.cs" />
+    <Compile Include="Math\Vector4h.cs" />
+    <Compile Include="Platform\Common\Hid.cs" />
+    <Compile Include="Platform\DisplayDeviceBase.cs" />
+    <Compile Include="Platform\DesktopGraphicsContext.cs" />
+    <Compile Include="Platform\DeviceCollection.cs" />
+    <Compile Include="Platform\Dummy\DummyGLContext.cs" />
+    <Compile Include="Platform\Dummy\DummyWindowInfo.cs" />
+    <Compile Include="Platform\Egl\AngleWindowInfo.cs" />
+    <Compile Include="Platform\Egl\Egl.cs" />
+    <Compile Include="Platform\Egl\EglAnglePlatformFactory.cs" />
+    <Compile Include="Platform\Egl\EglContext.cs" />
+    <Compile Include="Platform\Egl\EglException.cs" />
+    <Compile Include="Platform\Egl\EglGraphicsMode.cs" />
+    <Compile Include="Platform\Egl\EglSdl2PlatformFactory.cs" />
+    <Compile Include="Platform\Egl\EglWinContext.cs" />
+    <Compile Include="Platform\Egl\EglWindowInfo.cs" />
+    <Compile Include="Platform\Egl\EglWinPlatformFactory.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Platform\EmbeddedGraphicsContext.cs" />
+    <Compile Include="Platform\Factory.cs" />
+    <Compile Include="Platform\MappedGamePadDriver.cs" />
+    <Compile Include="Platform\NativeWindowBase.cs" />
+    <Compile Include="Platform\Windows\Bindings\HidProtocol.cs" />
+    <Compile Include="Platform\Windows\WinInputBase.cs" />
+    <Compile Include="Platform\Windows\WinRawJoystick.cs" />
+    <Compile Include="Platform\Windows\XInputJoystick.cs" />
+    <Compile Include="Platform\Windows\WinRawKeyboard.cs" />
+    <Compile Include="Platform\Windows\WinFactory.cs" />
+    <Compile Include="Platform\Windows\WinRawInput.cs" />
+    <Compile Include="Platform\Windows\WinRawMouse.cs" />
+    <Compile Include="Platform\Windows\WinDisplayDevice.cs" />
+    <Compile Include="Platform\Windows\API.cs" />
+    <Compile Include="Platform\Windows\WinKeyMap.cs" />
+    <Compile Include="Platform\Windows\WinGLNative.cs" />
+    <Compile Include="Platform\Windows\WinWindowInfo.cs" />
+    <Compile Include="Platform\Windows\WinGLContext.cs" />
+    <Compile Include="Platform\Windows\WglHelper.cs" />
+    <Compile Include="Platform\Windows\WinGraphicsMode.cs" />
+    <Compile Include="Platform\Windows\Bindings\Wgl.cs" />
+    <Compile Include="Platform\Windows\Bindings\WglEnums.cs" />
+    <Compile Include="Platform\IDisplayDeviceDriver.cs" />
+    <Compile Include="Platform\IWindowInfo.cs" />
+    <Compile Include="Platform\IPlatformFactory.cs" />
+    <Compile Include="Platform\PlatformException.cs" />
+    <Compile Include="Platform\SDL2\Sdl2DisplayDeviceDriver.cs" />
+    <Compile Include="Platform\SDL2\Sdl2Factory.cs" />
+    <Compile Include="Platform\SDL2\Sdl2GraphicsContext.cs" />
+    <Compile Include="Platform\SDL2\Sdl2GraphicsMode.cs" />
+    <Compile Include="Platform\SDL2\Sdl2InputDriver.cs" />
+    <Compile Include="Platform\SDL2\Sdl2KeyMap.cs" />
+    <Compile Include="Platform\SDL2\Sdl2Keyboard.cs" />
+    <Compile Include="Platform\SDL2\Sdl2Mouse.cs" />
+    <Compile Include="Platform\SDL2\Sdl2NativeWindow.cs" />
+    <Compile Include="Platform\SDL2\Sdl2WindowInfo.cs" />
+    <Compile Include="Platform\SDL2\Sdl2.cs" />
+    <Compile Include="Platform\SDL2\Sdl2JoystickDriver.cs" />
+    <Compile Include="Platform\Utilities.cs" />
+
+    <None Include="..\..\OpenTK.snk">
+      <Link>OpenTK.snk</Link>
+    </None>
+    <EmbeddedResource Include="OpenTK.dll.config">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </EmbeddedResource>
+
+    <None Include="OpenTK.Tizen.csproj.paket.template" />
+    <None Include="paket.references" />
+  </ItemGroup>
+  <ItemGroup>
+    <AdditionalFiles Include="$(SolutionDir)\stylecop.json">
+      <Link>stylecop.json</Link>
+    </AdditionalFiles>
+    <AdditionalFiles Include="$(SolutionDir)\stylecop.ruleset">
+      <Link>stylecop.ruleset</Link>
+    </AdditionalFiles>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PreBuildEvent>
+    </PreBuildEvent>
+    <PostBuildEvent>
+    </PostBuildEvent>
+  </PropertyGroup>
+  <Target Name="AfterBuild">
+    <Exec
+      Condition="$(OS) == 'Windows_NT' and $(Configuration) == 'Debug'"
+      Command="$(OutputPath)..\..\..\..\Generator.Rewrite\bin\Debug\Rewrite.exe --assembly $(OutputPath)OpenTK.dll --signing-key ..\..\..\OpenTK.snk --debug" />
+    <Exec
+      Condition="$(OS) == 'Windows_NT' and $(Configuration) == 'Release'"
+      Command="$(OutputPath)..\..\..\..\Generator.Rewrite\bin\Release\Rewrite.exe --assembly $(OutputPath)OpenTK.dll --signing-key ..\..\..\OpenTK.snk" />
+    <Exec
+      Condition="$(OS) != 'Windows_NT' and $(Configuration) == 'Debug'"
+      Command="mono $(OutputPath)../../../../Generator.Rewrite/bin/Debug/Rewrite.exe --assembly $(OutputPath)OpenTK.dll --signing-key ../../../OpenTK.snk --debug"  />
+    <Exec
+      Condition="$(OS) != 'Windows_NT' and $(Configuration) == 'Release'"
+      Command="mono $(OutputPath)../../../../Generator.Rewrite/bin/Release/Rewrite.exe --assembly $(OutputPath)OpenTK.dll --signing-key ../../../OpenTK.snk"  />
+  </Target>
+  <ProjectExtensions>
+    <MonoDevelop>
+      <Properties>
+        <Policies>
+          <TextStylePolicy inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/plain" />
+          <CSharpFormattingPolicy IndentSwitchBody="True" AnonymousMethodBraceStyle="NextLine" PropertyBraceStyle="NextLine" PropertyGetBraceStyle="NextLine" PropertySetBraceStyle="NextLine" EventBraceStyle="NextLine" EventAddBraceStyle="NextLine" EventRemoveBraceStyle="NextLine" StatementBraceStyle="NextLine" ElseNewLinePlacement="NewLine" CatchNewLinePlacement="NewLine" FinallyNewLinePlacement="NewLine" WhileNewLinePlacement="NewLine" ArrayInitializerBraceStyle="NextLine" BeforeMethodDeclarationParentheses="False" BeforeMethodCallParentheses="False" BeforeConstructorDeclarationParentheses="False" BeforeIndexerDeclarationBracket="False" BeforeDelegateDeclarationParentheses="False" NewParentheses="False" SpacesBeforeBrackets="False" BlankLinesBeforeFirstDeclaration="1" AlignToFirstMethodDeclarationParameter="False" AlignToFirstIndexerDeclarationParameter="False" inheritsSet="Mono" inheritsScope="text/x-csharp" scope="text/x-csharp" />
+          <TextStylePolicy FileWidth="120" inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/x-csharp" />
+          <StandardHeader Text="#region License&#xA;&#xA;${FileName}&#xA; &#xA;Author:&#xA;      ${AuthorName} &lt;${AuthorEmail}&gt;&#xA;&#xA;Copyright (c) 2006-${Year} ${CopyrightHolder}&#xA;&#xA;Permission is hereby granted, free of charge, to any person obtaining a copy&#xA;of this software and associated documentation files (the &quot;Software&quot;), to deal&#xA;in the Software without restriction, including without limitation the rights&#xA;to use, copy, modify, merge, publish, distribute, sublicense, and/or sell&#xA;copies of the Software, and to permit persons to whom the Software is&#xA;furnished to do so, subject to the following conditions:&#xA;&#xA;The above copyright notice and this permission notice shall be included in&#xA;all copies or substantial portions of the Software.&#xA;&#xA;THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR&#xA;IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,&#xA;FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE&#xA;AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER&#xA;LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,&#xA;OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN&#xA;THE SOFTWARE.&#xA;&#xA;#endregion" IncludeInNewFiles="True" />
+          <TextStylePolicy TabWidth="2" IndentWidth="2" NoTabsAfterNonTabs="True" inheritsSet="VisualStudio" inheritsScope="text/plain" scope="application/xml" />
+          <XmlFormattingPolicy inheritsSet="Mono" inheritsScope="application/xml" scope="application/xml" />
+        </Policies>
+      </Properties>
+    </MonoDevelop>
+  </ProjectExtensions>
+  <ItemGroup>
+    <Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll">
+      <Paket>True</Paket>
+    </Analyzer>
+    <Analyzer Include="..\..\packages\StyleCop.Analyzers\analyzers\dotnet\cs\StyleCop.Analyzers.dll">
+      <Paket>True</Paket>
+    </Analyzer>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/src/OpenTK/OpenTK.Tizen.csproj.paket.template b/src/OpenTK/OpenTK.Tizen.csproj.paket.template
new file mode 100755 (executable)
index 0000000..c32072e
--- /dev/null
@@ -0,0 +1,26 @@
+type project
+id OpenTK.Tizen
+owners
+    opentk thefiddler
+authors
+    The Open Toolkit Team
+projectUrl
+    http://www.opentk.com
+iconUrl
+    https://raw.githubusercontent.com/opentk/opentk/master/docs/files/img/logo.png
+licenseUrl
+    http://github.com/opentk/opentk/blob/master/License.txt
+requireLicenseAcceptance
+    false
+copyright
+    Copyright (c) 2006 - 2016 Stefanos Apostolopoulos <stapostol@gmail.com> for the Open Toolkit library.
+tags
+    OpenTK OpenGL OpenAL OpenCL C# F# VB .Net Mono Graphics Game Scientific Science 3D 2D Math Input Gamepad Joystick
+summary
+    A set of fast, low-level C# bindings for OpenGL, OpenGL ES and OpenAL.
+description
+    The Open Toolkit is set of fast, low-level C# bindings for OpenGL, OpenGL ES and OpenAL. It runs on all major platforms and powers hundreds of apps, games and scientific research.
+    OpenTK provides several utility libraries, including a math/linear algebra package, a windowing system, and input handling.
+include-pdbs true
+excludeddependencies
+    StyleCop.Analyzers
old mode 100644 (file)
new mode 100755 (executable)
index 7e31380..4382802
@@ -208,11 +208,18 @@ namespace OpenTK.Platform.Egl
         public const int D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE = 0x3200;
         // EGL_ANGLE_window_fixed_size
         public const int FIXED_SIZE_ANGLE = 0x3201;
+
+        #if TIZEN
+        private const string Library = "libEGL.so";
+        #else
+        private const string Library = "libEGL.dll";
+        #endif
+
         // EGL_ANGLE_query_surface_pointer
-        [DllImport("libEGL.dll", EntryPoint = "eglQuerySurfacePointerANGLE")]
+        [DllImport(Library, EntryPoint = "eglQuerySurfacePointerANGLE")]
         public static extern bool QuerySurfacePointerANGLE(EGLDisplay display, EGLSurface surface, int attribute, out IntPtr value);
 
-        [DllImport("libEGL.dll", EntryPoint = "eglGetPlatformDisplayEXT")]
+        [DllImport(Library, EntryPoint = "eglGetPlatformDisplayEXT")]
         public static extern EGLDisplay GetPlatformDisplay(int platform, EGLNativeDisplayType displayId, int[] attribList);
 
         // EGL_ANGLE_software_display
@@ -243,87 +250,87 @@ namespace OpenTK.Platform.Egl
         // See EGL_ANGLE_surface_d3d_texture_2d_share_handle
         public const int EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE = 0x3200;
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglGetError")]
+        [DllImportAttribute(Library, EntryPoint = "eglGetError")]
         public static extern ErrorCode GetError();
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglGetDisplay")]
+        [DllImportAttribute(Library, EntryPoint = "eglGetDisplay")]
         public static extern EGLDisplay GetDisplay(EGLNativeDisplayType display_id);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglInitialize")]
+        [DllImportAttribute(Library, EntryPoint = "eglInitialize")]
         //[return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool Initialize(EGLDisplay dpy, out int major, out int minor);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglTerminate")]
+        [DllImportAttribute(Library, EntryPoint = "eglTerminate")]
         //[return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool Terminate(EGLDisplay dpy);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglQueryString")]
+        [DllImportAttribute(Library, EntryPoint = "eglQueryString")]
         public static extern IntPtr QueryString(EGLDisplay dpy, int name);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglGetConfigs")]
+        [DllImportAttribute(Library, EntryPoint = "eglGetConfigs")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool GetConfigs(EGLDisplay dpy, EGLConfig[] configs, int config_size, out int num_config);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglChooseConfig")]
+        [DllImportAttribute(Library, EntryPoint = "eglChooseConfig")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool ChooseConfig(EGLDisplay dpy, int[] attrib_list, [In, Out] EGLConfig[] configs, int config_size, out int num_config);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglGetConfigAttrib")]
+        [DllImportAttribute(Library, EntryPoint = "eglGetConfigAttrib")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool GetConfigAttrib(EGLDisplay dpy, EGLConfig config, int attribute, out int value);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglCreateWindowSurface")]
+        [DllImportAttribute(Library, EntryPoint = "eglCreateWindowSurface")]
         public static extern  EGLSurface CreateWindowSurface(EGLDisplay dpy, EGLConfig config, IntPtr win, IntPtr attrib_list);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglCreatePbufferSurface")]
+        [DllImportAttribute(Library, EntryPoint = "eglCreatePbufferSurface")]
         public static extern EGLSurface CreatePbufferSurface(EGLDisplay dpy, EGLConfig config, int[] attrib_list);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglCreatePixmapSurface")]
+        [DllImportAttribute(Library, EntryPoint = "eglCreatePixmapSurface")]
         public static extern EGLSurface CreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, int[] attrib_list);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglDestroySurface")]
+        [DllImportAttribute(Library, EntryPoint = "eglDestroySurface")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool DestroySurface(EGLDisplay dpy, EGLSurface surface);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglQuerySurface")]
+        [DllImportAttribute(Library, EntryPoint = "eglQuerySurface")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool QuerySurface(EGLDisplay dpy, EGLSurface surface, int attribute, out int value);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglBindAPI")]
+        [DllImportAttribute(Library, EntryPoint = "eglBindAPI")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool BindAPI(RenderApi api);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglQueryAPI")]
+        [DllImportAttribute(Library, EntryPoint = "eglQueryAPI")]
         public static extern int QueryAPI();
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglWaitClient")]
+        [DllImportAttribute(Library, EntryPoint = "eglWaitClient")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool WaitClient();
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglReleaseThread")]
+        [DllImportAttribute(Library, EntryPoint = "eglReleaseThread")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool ReleaseThread();
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglCreatePbufferFromClientBuffer")]
+        [DllImportAttribute(Library, EntryPoint = "eglCreatePbufferFromClientBuffer")]
         public static extern EGLSurface CreatePbufferFromClientBuffer(EGLDisplay dpy, int buftype, EGLClientBuffer buffer, EGLConfig config, int[] attrib_list);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglSurfaceAttrib")]
+        [DllImportAttribute(Library, EntryPoint = "eglSurfaceAttrib")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool SurfaceAttrib(EGLDisplay dpy, EGLSurface surface, int attribute, int value);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglBindTexImage")]
+        [DllImportAttribute(Library, EntryPoint = "eglBindTexImage")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool BindTexImage(EGLDisplay dpy, EGLSurface surface, int buffer);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglReleaseTexImage")]
+        [DllImportAttribute(Library, EntryPoint = "eglReleaseTexImage")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool ReleaseTexImage(EGLDisplay dpy, EGLSurface surface, int buffer);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglSwapInterval")]
+        [DllImportAttribute(Library, EntryPoint = "eglSwapInterval")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool SwapInterval(EGLDisplay dpy, int interval);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglCreateContext")]
+        [DllImportAttribute(Library, EntryPoint = "eglCreateContext")]
         private static extern IntPtr eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, int[] attrib_list);
 
         public static EGLContext CreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, int[] attrib_list)
@@ -336,57 +343,57 @@ namespace OpenTK.Platform.Egl
             return ptr;
         }
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglDestroyContext")]
+        [DllImportAttribute(Library, EntryPoint = "eglDestroyContext")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool DestroyContext(EGLDisplay dpy, EGLContext ctx);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglMakeCurrent")]
+        [DllImportAttribute(Library, EntryPoint = "eglMakeCurrent")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool MakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglGetCurrentContext")]
+        [DllImportAttribute(Library, EntryPoint = "eglGetCurrentContext")]
         public static extern EGLContext GetCurrentContext();
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglGetCurrentSurface")]
+        [DllImportAttribute(Library, EntryPoint = "eglGetCurrentSurface")]
         public static extern EGLSurface GetCurrentSurface(int readdraw);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglGetCurrentDisplay")]
+        [DllImportAttribute(Library, EntryPoint = "eglGetCurrentDisplay")]
         public static extern EGLDisplay GetCurrentDisplay();
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglQueryContext")]
+        [DllImportAttribute(Library, EntryPoint = "eglQueryContext")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool QueryContext(EGLDisplay dpy, EGLContext ctx, int attribute, out int value);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglWaitGL")]
+        [DllImportAttribute(Library, EntryPoint = "eglWaitGL")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool WaitGL();
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglWaitNative")]
+        [DllImportAttribute(Library, EntryPoint = "eglWaitNative")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool WaitNative(int engine);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglSwapBuffers")]
+        [DllImportAttribute(Library, EntryPoint = "eglSwapBuffers")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool SwapBuffers(EGLDisplay dpy, EGLSurface surface);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglCopyBuffers")]
+        [DllImportAttribute(Library, EntryPoint = "eglCopyBuffers")]
         [return: MarshalAsAttribute(UnmanagedType.I1)]
         public static extern bool CopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglGetProcAddress")]
+        [DllImportAttribute(Library, EntryPoint = "eglGetProcAddress")]
         public static extern IntPtr GetProcAddress(string funcname);
 
-        [DllImportAttribute("libEGL.dll", EntryPoint = "eglGetProcAddress")]
+        [DllImportAttribute(Library, EntryPoint = "eglGetProcAddress")]
         public static extern IntPtr GetProcAddress(IntPtr funcname);
 
         // EGL_EXT_platform_base
-        [DllImport("libEGL.dll", EntryPoint = "eglGetPlatformDisplayEXT")]
+        [DllImport(Library, EntryPoint = "eglGetPlatformDisplayEXT")]
         public static extern EGLDisplay GetPlatformDisplayEXT(int platform, EGLNativeDisplayType native_display, int[] attrib_list);
 
-        [DllImport("libEGL.dll", EntryPoint = "eglCreatePlatformWindowSurfaceEXT")]
+        [DllImport(Library, EntryPoint = "eglCreatePlatformWindowSurfaceEXT")]
         public static extern EGLSurface CreatePlatformWindowSurfaceEXT(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType native_window, int[] attrib_list);
 
-        [DllImport("libEGL.dll", EntryPoint = "eglCreatePlatformPixmapSurfaceEXT")]
+        [DllImport(Library, EntryPoint = "eglCreatePlatformPixmapSurfaceEXT")]
         public static extern EGLSurface CreatePlatformPixmapSurfaceEXT(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType native_pixmap, int[] attrib_list);
 
         // Returns true if Egl drivers exist on the system.
old mode 100644 (file)
new mode 100755 (executable)
index 130a3fd..3426736
@@ -41,6 +41,8 @@ namespace OpenTK.Platform.SDL2
         const string lib = "libSDL2.so";
         #elif IPHONE
         const string lib = "__Internal";
+        #elif TIZEN
+        private const string lib = "libSDL2-2.0.so.0";
         #else
         private const string lib = "SDL2.dll";
         #endif
@@ -111,6 +113,14 @@ namespace OpenTK.Platform.SDL2
         public static extern IntPtr CreateWindow(string title, int x, int y, int w, int h, WindowFlags flags);
 
         [SuppressUnmanagedCodeSecurity]
+        [DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetMainReady", ExactSpelling = true)]
+        public static extern void SetMainReady();
+
+        [SuppressUnmanagedCodeSecurity]
+        [DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetHint", ExactSpelling = true)]
+        public static extern IntPtr SetHint(string name, string value);
+
+        [SuppressUnmanagedCodeSecurity]
         [DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_CreateWindowFrom", ExactSpelling = true)]
         public static extern IntPtr CreateWindowFrom(IntPtr data);
 
old mode 100644 (file)
new mode 100755 (executable)
index a04effc..e327836
@@ -77,7 +77,13 @@ namespace OpenTK.Platform.SDL2
                 var bounds = device.Bounds;
                 var flags = TranslateFlags(options);
                 flags |= WindowFlags.OPENGL;
+
+                #if TIZEN
+                flags |= WindowFlags.SHOWN;
+                #else
                 flags |= WindowFlags.HIDDEN;
+                #endif
+
                 if (Toolkit.Options.EnableHighResolution)
                 {
                     flags |= WindowFlags.ALLOW_HIGHDPI;
@@ -104,6 +110,10 @@ namespace OpenTK.Platform.SDL2
                 window = new Sdl2WindowInfo(handle, null);
                 window_id = SDL.GetWindowID(handle);
                 windows.Add(window_id, this);
+
+                #if TIZEN
+                SDL.SetHint("SDL_IOS_ORIENTATIONS", "Portrait LandscapeLeft LandscapeRight PortraitUpsideDown");
+                #endif
             }
         }