Merge branch 'nuget'

This commit is contained in:
Stefanos A 2013-12-15 13:23:16 +01:00
commit 38821d0a0e
14 changed files with 357 additions and 142 deletions

4
.gitignore vendored
View file

@ -3,11 +3,15 @@ Binaries/
OpenTK.userprefs
Source/GlobalAssemblyInfo.cs
Version.txt
Build.txt
Timestamp.txt
Source/OpenTK/OpenTK.xml
Source/GLControl/OpenTK.GLControl.xml
Documentation/Source
opentk*.exe
opentk*.zip
opentk*.nupkg
Installers/Nuget/lib
# OpenTK Resource files that seem like they should be ignored:
Source/Compatibility/Properties/Resources.resources

View file

@ -49,7 +49,7 @@
</ItemGroup>
<Target Name="Build">
<Exec Command="makensis opentk.nsi" />
<ReadLinesFromFile File="../../Version.txt">
<ReadLinesFromFile File="../../Timestamp.txt">
<Output TaskParameter="Lines" ItemName="Version" />
</ReadLinesFromFile>
<Move SourceFiles=".\opentk.exe" DestinationFiles="@(Version-&gt;'../../opentk-%(Identity).exe')" />

View file

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)' == 'Documentation'">
<OutputPath>.\obj\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<OutputPath>.\obj\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<OutputPath>.\obj\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Nsis'">
<OutputPath>.\obj\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<ProjectGuid>{ADC34399-7613-44D2-90B2-19250F12FE7B}</ProjectGuid>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<OutputPath>.\obj\</OutputPath>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<OutputType>Exe</OutputType>
<AssemblyName>Build.Installer.Nuget</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Documentation|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>False</Optimize>
<OutputPath>obj\</OutputPath>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>False</Optimize>
<OutputPath>obj\</OutputPath>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>False</Optimize>
<OutputPath>obj\</OutputPath>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Nsis|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>False</Optimize>
<OutputPath>obj\</OutputPath>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<Target Name="Build">
<!-- Copy built files to the tree format expected by nuget -->
<CreateItem Include="../../Binaries/OpenTK/Release/OpenTK*">
<Output TaskParameter="Include" ItemName="Binaries" />
</CreateItem>
<Copy SourceFiles="@(Binaries)" DestinationFolder="./lib/net20" />
<!-- Update version information -->
<ReadLinesFromFile File="../../Version.txt">
<Output TaskParameter="Lines" ItemName="Version" />
</ReadLinesFromFile>
<!-- Execute nuget script -->
<Exec Command="nuget.exe pack OpenTK.nuspec -Version @(Version)" Condition="$(OS) == 'Windows_NT'" />
<Exec Command="nuget.exe pack OpenTK.GLControl.nuspec -Version @(Version)" Condition="$(OS) == 'Windows_NT'" />
<Exec Command="mono nuget.exe pack OpenTK.nuspec -Version @(Version)" Condition="$(OS) != 'Windows_NT'" />
<Exec Command="mono nuget.exe pack OpenTK.GLControl.nuspec -Version @(Version)" Condition="$(OS) != 'Windows_NT'" />
<!-- Copy the nuget archive to the root directory and add a date stamp -->
<CreateItem Include="OpenTK*.nupkg">
<Output TaskParameter="Include" ItemName="NugetPackage" />
</CreateItem>
<Copy SourceFiles="@(NugetPackage)" DestinationFolder="../../" />
</Target>
<Target Name="Clean">
<CreateItem Include="OpenTK.*.nupkg;lib/**">
<Output TaskParameter="Include" ItemName="FilesToDelete" />
</CreateItem>
<Delete Files="@(FilesToDelete)" />
</Target>
<Target Name="Rebuild">
<CallTarget Targets="Clean" />
<CallTarget Targets="Build" />
</Target>
<ItemGroup>
<None Include="OpenTK.nuspec" />
<None Include="OpenTK.GLControl.nuspec" />
</ItemGroup>
<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>
</Project>

View file

@ -0,0 +1,49 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>OpenTK.GLControl</id>
<version>$version$</version>
<authors>Stefanos Apostolopoulos</authors>
<owners>Stefanos Apostolopoulos</owners>
<licenseUrl>http://www.opentk.com/project/license</licenseUrl>
<projectUrl>http://www.opentk.com</projectUrl>
<iconUrl>file:///./logo.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<summary>
Add OpenGL graphics to your Windows.Forms or WPF application
</summary>
<description>
OpenTK.GLControl is a Windows.Forms Control with OpenGL rendering capabilities. Use it to add
accelerated 3d graphics to your Windows.Forms or Windows Presentation Foundation (WPF) application.
Features
- Integrate 3d graphics into your Windows.Forms or WPF application
- Use the .Net/Mono language of your choice: C#, F#, VB.Net, Boo, IronPython, IronRuby
- Develop faster with inline documentation and strongly-typed enumerations for all OpenGL and OpenAL functions
This is the official nuget package from http://www.opentk.com
The source code can be found at https://github.com/opentk/opentk
</description>
<releaseNotes>
http://www.opentk.com/news
</releaseNotes>
<copyright>Copyright 2006-2013 Stefanos Apostolopoulos</copyright>
<tags>OpenTK OpenGL WinForms WPF C# F# VB .Net Mono</tags>
<references>
<reference file="OpenTK.GLControl.dll" />
</references>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System" />
<frameworkAssembly assemblyName="System.Drawing" />
<frameworkAssembly assemblyName="System.Windows.Forms" />
<frameworkAssembly assemblyName="System.Xml" />
</frameworkAssemblies>
<dependencies>
<dependency id="OpenTK" version="1.1.0.0" />
</dependencies>
</metadata>
<files>
<file src="lib/net20/OpenTK.GLControl.dll" target="lib/net20" />
<file src="lib/net20/OpenTK.GLControl.xml" target="lib/net20" />
</files>
</package>

View file

@ -0,0 +1,48 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>OpenTK</id>
<version>$version$</version>
<authors>Stefanos Apostolopoulos</authors>
<owners>Stefanos Apostolopoulos</owners>
<licenseUrl>http://www.opentk.com/project/license</licenseUrl>
<projectUrl>http://www.opentk.com</projectUrl>
<iconUrl>file:///./logo.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<summary>
The Open Toolkit library (OpenTK) is an advanced, low-level C# wrapper for OpenGL, OpenGL ES and OpenAL.
</summary>
<description>
The Open Toolkit library (OpenTK) is an advanced, low-level C# wrapper for OpenGL, OpenGL ES and OpenAL.
It is suitable for games, scientific visualizations and projects that require 3d graphics, audio or compute functionality.
Features
- Create cutting-edge graphics with OpenGL 4.4 and OpenGL ES 3.0
- Integrate 3d graphics into your Windows.Forms, WPF or GTK# applications
- Write once run everywhere: Windows, Mac OS X, Linux, Android and iOS
- Use the .Net/Mono language of your choice: C#, F#, VB.Net, Boo, IronPython, IronRuby
- Develop faster with inline documentation and strongly-typed enumerations for all OpenGL and OpenAL functions
This is the official nuget package from http://www.opentk.com
The source code can be found at https://github.com/opentk/opentk
</description>
<releaseNotes>
http://www.opentk.com/news
</releaseNotes>
<copyright>Copyright 2006-2013 Stefanos Apostolopoulos</copyright>
<tags>OpenTK OpenGL OpenGLES OpenAL C# F# VB .Net Mono</tags>
<references>
<reference file="OpenTK.dll" />
</references>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System" />
<frameworkAssembly assemblyName="System.Drawing" />
<frameworkAssembly assemblyName="System.Xml" />
</frameworkAssemblies>
</metadata>
<files>
<file src="lib/net20/OpenTK.dll" target="lib/net20" />
<file src="lib/net20/OpenTK.xml" target="lib/net20" />
<file src="lib/net20/OpenTK.dll.config" target="content" />
</files>
</package>

BIN
Installers/Nuget/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View file

@ -51,7 +51,7 @@
<!-- Zip the copy of the source tree -->
<Exec Command="7z a -tzip opentk.zip ../../* -xr!opentk*.zip -xr!opentk*.exe -xr!.* -xr!obj -xr!bin -xr!Documentation/Source -xr!Automation -xr!*.suo -xr!*.pidb -xr!*.userprefs -xr!*vshost.exe* -xr!*.log" />
<!-- Copy the zip file to the root directory and add a date stamp -->
<ReadLinesFromFile File="../../Version.txt">
<ReadLinesFromFile File="../../Timestamp.txt">
<Output TaskParameter="Lines" ItemName="Version" />
</ReadLinesFromFile>
<Move SourceFiles=".\opentk.zip" DestinationFiles="@(Version-&gt;'..\..\opentk-%(Identity).zip')" />

View file

@ -1,52 +1,27 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2012
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTK", "Source\OpenTK\OpenTK.csproj", "{A37A7E14-0000-0000-0000-000000000000}"
ProjectSection(ProjectDependencies) = postProject
{75DC22B1-113F-4A66-96B9-2FF8208C10E8} = {75DC22B1-113F-4A66-96B9-2FF8208C10E8}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTK.Compatibility", "Source\Compatibility\OpenTK.Compatibility.csproj", "{62C0DB35-0000-0000-0000-000000000000}"
ProjectSection(ProjectDependencies) = postProject
{75DC22B1-113F-4A66-96B9-2FF8208C10E8} = {75DC22B1-113F-4A66-96B9-2FF8208C10E8}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTK.Examples", "Source\Examples\OpenTK.Examples.csproj", "{868E37B3-0000-0000-0000-000000000000}"
ProjectSection(ProjectDependencies) = postProject
{75DC22B1-113F-4A66-96B9-2FF8208C10E8} = {75DC22B1-113F-4A66-96B9-2FF8208C10E8}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTK.GLControl", "Source\GLControl\OpenTK.GLControl.csproj", "{A625BE88-0000-0000-0000-000000000000}"
ProjectSection(ProjectDependencies) = postProject
{75DC22B1-113F-4A66-96B9-2FF8208C10E8} = {75DC22B1-113F-4A66-96B9-2FF8208C10E8}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Build.Installer.Nsis", "Installers\Nsis\Build.Installer.Nsis.csproj", "{ADC34399-7613-44D2-90B2-19250F06FE7A}"
ProjectSection(ProjectDependencies) = postProject
{75DC22B1-113F-4A66-96B9-2FF8208C10E8} = {75DC22B1-113F-4A66-96B9-2FF8208C10E8}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Build.Docs", "Documentation\Build.Docs.csproj", "{650C6F3D-33B5-4216-9536-956AB42C0624}"
ProjectSection(ProjectDependencies) = postProject
{75DC22B1-113F-4A66-96B9-2FF8208C10E8} = {75DC22B1-113F-4A66-96B9-2FF8208C10E8}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generator.Bind", "Source\Bind\Generator.Bind.csproj", "{31D19132-0000-0000-0000-000000000000}"
ProjectSection(ProjectDependencies) = postProject
{75DC22B1-113F-4A66-96B9-2FF8208C10E8} = {75DC22B1-113F-4A66-96B9-2FF8208C10E8}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generator.Convert", "Source\Converter\Generator.Convert.csproj", "{5FDFF4B6-0000-0000-0000-000000000000}"
ProjectSection(ProjectDependencies) = postProject
{75DC22B1-113F-4A66-96B9-2FF8208C10E8} = {75DC22B1-113F-4A66-96B9-2FF8208C10E8}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Build.UpdateVersion", "Source\Build.UpdateVersion\Build.UpdateVersion.csproj", "{75DC22B1-113F-4A66-96B9-2FF8208C10E8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Build.Installer.Zip", "Installers\Zip\Build.Installer.Zip.csproj", "{ADC34399-7613-44D2-90B2-19250F06FE7B}"
ProjectSection(ProjectDependencies) = postProject
{75DC22B1-113F-4A66-96B9-2FF8208C10E8} = {75DC22B1-113F-4A66-96B9-2FF8208C10E8}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Build.Installer.Nuget", "Installers\Nuget\Build.Installer.Nuget.csproj", "{ADC34399-7613-44D2-90B2-19250F12FE7B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -56,6 +31,52 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{31D19132-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{31D19132-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{31D19132-0000-0000-0000-000000000000}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
{31D19132-0000-0000-0000-000000000000}.Documentation|Any CPU.Build.0 = Documentation|Any CPU
{31D19132-0000-0000-0000-000000000000}.Nsis|Any CPU.ActiveCfg = Nsis|Any CPU
{31D19132-0000-0000-0000-000000000000}.Nsis|Any CPU.Build.0 = Nsis|Any CPU
{31D19132-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
{31D19132-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
{5FDFF4B6-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5FDFF4B6-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5FDFF4B6-0000-0000-0000-000000000000}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
{5FDFF4B6-0000-0000-0000-000000000000}.Documentation|Any CPU.Build.0 = Documentation|Any CPU
{5FDFF4B6-0000-0000-0000-000000000000}.Nsis|Any CPU.ActiveCfg = Nsis|Any CPU
{5FDFF4B6-0000-0000-0000-000000000000}.Nsis|Any CPU.Build.0 = Nsis|Any CPU
{5FDFF4B6-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5FDFF4B6-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
{62C0DB35-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{62C0DB35-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{62C0DB35-0000-0000-0000-000000000000}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
{62C0DB35-0000-0000-0000-000000000000}.Documentation|Any CPU.Build.0 = Documentation|Any CPU
{62C0DB35-0000-0000-0000-000000000000}.Nsis|Any CPU.ActiveCfg = Nsis|Any CPU
{62C0DB35-0000-0000-0000-000000000000}.Nsis|Any CPU.Build.0 = Nsis|Any CPU
{62C0DB35-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
{62C0DB35-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
{650C6F3D-33B5-4216-9536-956AB42C0624}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{650C6F3D-33B5-4216-9536-956AB42C0624}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
{650C6F3D-33B5-4216-9536-956AB42C0624}.Documentation|Any CPU.Build.0 = Documentation|Any CPU
{650C6F3D-33B5-4216-9536-956AB42C0624}.Nsis|Any CPU.ActiveCfg = Nsis|Any CPU
{650C6F3D-33B5-4216-9536-956AB42C0624}.Nsis|Any CPU.Build.0 = Nsis|Any CPU
{650C6F3D-33B5-4216-9536-956AB42C0624}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75DC22B1-113F-4A66-96B9-2FF8208C10E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75DC22B1-113F-4A66-96B9-2FF8208C10E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75DC22B1-113F-4A66-96B9-2FF8208C10E8}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
{75DC22B1-113F-4A66-96B9-2FF8208C10E8}.Documentation|Any CPU.Build.0 = Documentation|Any CPU
{75DC22B1-113F-4A66-96B9-2FF8208C10E8}.Nsis|Any CPU.ActiveCfg = Nsis|Any CPU
{75DC22B1-113F-4A66-96B9-2FF8208C10E8}.Nsis|Any CPU.Build.0 = Nsis|Any CPU
{75DC22B1-113F-4A66-96B9-2FF8208C10E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75DC22B1-113F-4A66-96B9-2FF8208C10E8}.Release|Any CPU.Build.0 = Release|Any CPU
{868E37B3-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{868E37B3-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{868E37B3-0000-0000-0000-000000000000}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
{868E37B3-0000-0000-0000-000000000000}.Documentation|Any CPU.Build.0 = Documentation|Any CPU
{868E37B3-0000-0000-0000-000000000000}.Nsis|Any CPU.ActiveCfg = Nsis|Any CPU
{868E37B3-0000-0000-0000-000000000000}.Nsis|Any CPU.Build.0 = Nsis|Any CPU
{868E37B3-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
{868E37B3-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
{A37A7E14-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A37A7E14-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A37A7E14-0000-0000-0000-000000000000}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
@ -63,20 +84,6 @@ Global
{A37A7E14-0000-0000-0000-000000000000}.Nsis|Any CPU.Build.0 = Nsis|Any CPU
{A37A7E14-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A37A7E14-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
{62C0DB35-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{62C0DB35-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{62C0DB35-0000-0000-0000-000000000000}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
{62C0DB35-0000-0000-0000-000000000000}.Nsis|Any CPU.ActiveCfg = Nsis|Any CPU
{62C0DB35-0000-0000-0000-000000000000}.Nsis|Any CPU.Build.0 = Nsis|Any CPU
{62C0DB35-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
{62C0DB35-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
{868E37B3-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{868E37B3-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{868E37B3-0000-0000-0000-000000000000}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
{868E37B3-0000-0000-0000-000000000000}.Nsis|Any CPU.ActiveCfg = Nsis|Any CPU
{868E37B3-0000-0000-0000-000000000000}.Nsis|Any CPU.Build.0 = Nsis|Any CPU
{868E37B3-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
{868E37B3-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
{A625BE88-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A625BE88-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A625BE88-0000-0000-0000-000000000000}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
@ -89,44 +96,21 @@ Global
{ADC34399-7613-44D2-90B2-19250F06FE7A}.Nsis|Any CPU.ActiveCfg = Nsis|Any CPU
{ADC34399-7613-44D2-90B2-19250F06FE7A}.Nsis|Any CPU.Build.0 = Nsis|Any CPU
{ADC34399-7613-44D2-90B2-19250F06FE7A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{650C6F3D-33B5-4216-9536-956AB42C0624}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{650C6F3D-33B5-4216-9536-956AB42C0624}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
{650C6F3D-33B5-4216-9536-956AB42C0624}.Documentation|Any CPU.Build.0 = Documentation|Any CPU
{650C6F3D-33B5-4216-9536-956AB42C0624}.Nsis|Any CPU.ActiveCfg = Nsis|Any CPU
{650C6F3D-33B5-4216-9536-956AB42C0624}.Nsis|Any CPU.Build.0 = Nsis|Any CPU
{650C6F3D-33B5-4216-9536-956AB42C0624}.Release|Any CPU.ActiveCfg = Release|Any CPU
{31D19132-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{31D19132-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{31D19132-0000-0000-0000-000000000000}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
{31D19132-0000-0000-0000-000000000000}.Nsis|Any CPU.ActiveCfg = Nsis|Any CPU
{31D19132-0000-0000-0000-000000000000}.Nsis|Any CPU.Build.0 = Nsis|Any CPU
{31D19132-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
{31D19132-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
{5FDFF4B6-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5FDFF4B6-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5FDFF4B6-0000-0000-0000-000000000000}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
{5FDFF4B6-0000-0000-0000-000000000000}.Nsis|Any CPU.ActiveCfg = Nsis|Any CPU
{5FDFF4B6-0000-0000-0000-000000000000}.Nsis|Any CPU.Build.0 = Nsis|Any CPU
{5FDFF4B6-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5FDFF4B6-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
{75DC22B1-113F-4A66-96B9-2FF8208C10E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75DC22B1-113F-4A66-96B9-2FF8208C10E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75DC22B1-113F-4A66-96B9-2FF8208C10E8}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
{75DC22B1-113F-4A66-96B9-2FF8208C10E8}.Documentation|Any CPU.Build.0 = Documentation|Any CPU
{75DC22B1-113F-4A66-96B9-2FF8208C10E8}.Nsis|Any CPU.ActiveCfg = Nsis|Any CPU
{75DC22B1-113F-4A66-96B9-2FF8208C10E8}.Nsis|Any CPU.Build.0 = Nsis|Any CPU
{75DC22B1-113F-4A66-96B9-2FF8208C10E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75DC22B1-113F-4A66-96B9-2FF8208C10E8}.Release|Any CPU.Build.0 = Release|Any CPU
{ADC34399-7613-44D2-90B2-19250F06FE7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ADC34399-7613-44D2-90B2-19250F06FE7B}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
{ADC34399-7613-44D2-90B2-19250F06FE7B}.Nsis|Any CPU.ActiveCfg = Nsis|Any CPU
{ADC34399-7613-44D2-90B2-19250F06FE7B}.Nsis|Any CPU.Build.0 = Nsis|Any CPU
{ADC34399-7613-44D2-90B2-19250F06FE7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
{ADC34399-7613-44D2-90B2-19250F12FE7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ADC34399-7613-44D2-90B2-19250F12FE7B}.Documentation|Any CPU.ActiveCfg = Documentation|Any CPU
{ADC34399-7613-44D2-90B2-19250F12FE7B}.Nsis|Any CPU.ActiveCfg = Nsis|Any CPU
{ADC34399-7613-44D2-90B2-19250F12FE7B}.Nsis|Any CPU.Build.0 = Nsis|Any CPU
{ADC34399-7613-44D2-90B2-19250F12FE7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = Source\Examples\OpenTK.Examples.csproj
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -62,6 +62,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<Target Name="BeforeBuild">
<Delete Files="..\..\Timestamp.txt" />
<Delete Files="..\..\Version.txt" />
</Target>
<Target Name="AfterBuild">

View file

@ -56,44 +56,41 @@ namespace Build.UpdateVersion
}
DateTime now = DateTime.UtcNow;
GenerateVersionInfo(now, Path.Combine(RootDirectory, "Version.txt"));
GenerateAssemblyInfo(now, Path.Combine(SourceDirectory, "GlobalAssemblyInfo.cs"));
}
static void GenerateVersionInfo(DateTime now, string file)
{
string version = null;
if (System.IO.File.Exists(file))
{
string[] lines = System.IO.File.ReadAllLines(file);
if (lines.Length > 0 && !String.IsNullOrEmpty(lines[0]))
{
version = lines[0];
}
}
// If the file does not exist, create it.
if (version == null)
{
version = now.ToString("u").Split(' ')[0];
System.IO.File.WriteAllLines(file, new string[] { version });
}
}
static void GenerateAssemblyInfo(DateTime now, string file)
{
string timestamp = now.ToString("u").Split(' ')[0];
// Build number is defined as the number of days since 1/1/2010.
// Revision number is defined as the fraction of the current day, expressed in seconds.
double timespan = now.Subtract(new DateTime(2010, 1, 1)).TotalDays;
string build = ((int)timespan).ToString();
// Revision number is defined as the number of (git/svn/bzr) commits,
// or as the fraction of the current day, expressed in seconds, in case the
// working directory is not under source control.
string revision = RetrieveRevisionNumber(now);
string revision = RetrieveGitRevision() ?? RetrieveSvnRevision() ?? RetrieveBzrRevision() ?? RetrieveSeconds(timespan);
revision = revision.Trim();
Console.WriteLine("Build timestamp was: " + build);
Console.WriteLine("Revision detected was: " + revision);
string major = Major;
string minor = Minor;
// Version is defined as {Major}.{Minor}.{Build}.{Revision}
string version = String.Format("{0}.{1}.{2}.{3}", major, minor, build, revision);
Console.WriteLine("API compatibility key: {0}.{1}", major, minor);
Console.WriteLine("Build date: {0}", timestamp);
GenerateTimestamp(timestamp, Path.Combine(RootDirectory, "Timestamp.txt"));
GenerateVersion(version, Path.Combine(RootDirectory, "Version.txt"));
GenerateAssemblyInfo(major, minor, version, Path.Combine(SourceDirectory, "GlobalAssemblyInfo.cs"));
}
static void GenerateTimestamp(string timestamp, string file)
{
System.IO.File.WriteAllLines(file, new string[] { timestamp });
}
static void GenerateVersion(string version, string file)
{
File.WriteAllLines(file, new string[] { version });
}
static void GenerateAssemblyInfo(string major, string minor, string version, string file)
{
File.WriteAllLines(file, new string[]
{
"// This file is auto-generated through Source/Build.Tasks/GenerateAssemblyInfo.cs.",
@ -109,11 +106,19 @@ namespace Build.UpdateVersion
"[assembly: AssemblyProduct(\"The Open Toolkit Library\")]",
"[assembly: AssemblyCopyright(\"Copyright © 2006 - 2013 the Open Toolkit Library\")]",
"[assembly: AssemblyTrademark(\"OpenTK\")]",
String.Format("[assembly: AssemblyVersion(\"{0}.{1}.0.0\")]", Major, Minor),
String.Format("[assembly: AssemblyFileVersion(\"{0}.{1}.{2}.{3}\")]", Major, Minor, build, revision),
String.Format("[assembly: AssemblyVersion(\"{0}.{1}.0.0\")]", major, minor),
String.Format("[assembly: AssemblyFileVersion(\"{0}\")]", version),
});
}
static string RetrieveRevisionNumber(DateTime now)
{
double timespan = now.Subtract(new DateTime(2010, 1, 1)).TotalDays;
string revision = RetrieveGitRevision() ?? RetrieveSvnRevision() ?? RetrieveBzrRevision() ?? RetrieveSeconds(timespan);
revision = revision.Trim();
return revision;
}
static string RetrieveSeconds(double timespan)
{
string revision = ((int)((timespan - (int)timespan) * UInt16.MaxValue)).ToString();

View file

@ -47,7 +47,7 @@
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>DEBUG;TRACE;</DefineConstants>
<DocumentationFile>OpenTK.GLControl.xml</DocumentationFile>
<DocumentationFile>..\..\Binaries\OpenTK\Debug\OpenTK.GLControl.xml</DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
@ -64,7 +64,7 @@
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;</DefineConstants>
<DocumentationFile>OpenTK.GLControl.xml</DocumentationFile>
<DocumentationFile>..\..\Binaries\OpenTK\Release\OpenTK.GLControl.xml</DocumentationFile>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\Binaries\OpenTK\Release\</OutputPath>
@ -80,6 +80,8 @@
<WarningLevel>4</WarningLevel>
<Optimize>True</Optimize>
<DefineConstants>TRACE;</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile>..\..\Binaries\OpenTK\Release\OpenTK.GLControl.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Nsis|AnyCPU'">
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
@ -87,7 +89,7 @@
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;</DefineConstants>
<DocumentationFile>OpenTK.GLControl.xml</DocumentationFile>
<DocumentationFile>..\..\Binaries\OpenTK\Release\OpenTK.GLControl.xml</DocumentationFile>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\Binaries\OpenTK\Release\</OutputPath>

View file

@ -684,9 +684,9 @@ namespace OpenTK.Platform.MacOS.Carbon
char* codeAddr = &code;
OSStatus result = API.GetEventParameter(inEvent,
EventParamName.KeyMacCharCode, EventParamType.typeChar, IntPtr.Zero,
(uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(char)), IntPtr.Zero,
(IntPtr)codeAddr);
EventParamName.KeyMacCharCode, EventParamType.typeChar, IntPtr.Zero,
(uint)BlittableValueType<char>.Stride, IntPtr.Zero,
(IntPtr)codeAddr);
if (result != OSStatus.NoError)
{

View file

@ -383,7 +383,10 @@ namespace OpenTK.Platform.MacOS
case KeyboardEventKind.RawKeyDown:
Keymap.TryGetValue(code, out key);
InputDriver.Keyboard[0].SetKey(key, (uint)code, true);
OnKeyPress(mKeyPressArgs);
if (!Char.IsControl(mKeyPressArgs.KeyChar))
{
OnKeyPress(mKeyPressArgs);
}
return OSStatus.NoError;
case KeyboardEventKind.RawKeyUp:

View file

@ -59,6 +59,16 @@ namespace OpenTK.Platform.SDL2
Icon icon;
string window_title;
// Used in KeyPress event to decode SDL UTF8 text strings
// to .Net UTF16 strings
char[] DecodeTextBuffer = new char[32];
// Argument for KeyPress event (allocated once to avoid runtime allocations)
readonly KeyPressEventArgs keypress_args = new KeyPressEventArgs('\0');
// Argument for KeyDown and KeyUp events (allocated once to avoid runtime allocations)
readonly KeyboardKeyEventArgs key_args = new KeyboardKeyEventArgs();
readonly IInputDriver input_driver = new Sdl2InputDriver();
readonly EventFilter EventFilterDelegate_GCUnsafe = FilterEvents;
@ -226,39 +236,49 @@ namespace OpenTK.Platform.SDL2
{
bool key_pressed = ev.Key.State == State.Pressed;
var key = ev.Key.Keysym;
var args = new KeyboardKeyEventArgs()
{
Key = TranslateKey(key.Scancode),
ScanCode = (uint)key.Scancode
};
window.key_args.Key = TranslateKey(key.Scancode);
window.key_args.ScanCode = (uint)key.Scancode;
if (key_pressed)
window.KeyDown(window, args);
{
window.KeyDown(window, window.key_args);
}
else
window.KeyUp(window, args);
{
window.KeyUp(window, window.key_args);
}
//window.keyboard.SetKey(TranslateKey(key.scancode), (uint)key.scancode, key_pressed);
}
static unsafe void ProcessTextInputEvent(Sdl2NativeWindow window, TextInputEvent ev)
{
var keyPress = window.KeyPress;
if (keyPress != null)
// Calculate the length of the typed text string
int length;
for (length = 0; length < TextInputEvent.TextSize && ev.Text[length] != '\0'; length++)
;
// Make sure we have enough space to decode this string
int decoded_length = Encoding.UTF8.GetCharCount(ev.Text, length);
if (window.DecodeTextBuffer.Length < decoded_length)
{
var length = 0;
byte* pText = ev.Text;
while (*pText != 0)
{
length++;
pText++;
}
using (var stream = new System.IO.UnmanagedMemoryStream(ev.Text, length))
using (var reader = new System.IO.StreamReader(stream, Encoding.UTF8))
{
var text = reader.ReadToEnd();
foreach (var c in text)
{
keyPress(window, new KeyPressEventArgs(c));
}
}
Array.Resize(
ref window.DecodeTextBuffer,
2 * Math.Max(decoded_length, window.DecodeTextBuffer.Length));
}
// Decode the string from UTF8 to .Net UTF16
fixed (char* pBuffer = window.DecodeTextBuffer)
{
decoded_length = System.Text.Encoding.UTF8.GetChars(
ev.Text,
length,
pBuffer,
window.DecodeTextBuffer.Length);
}
for (int i = 0; i < decoded_length; i++)
{
window.keypress_args.KeyChar = window.DecodeTextBuffer[i];
window.KeyPress(window, window.keypress_args);
}
}