Permalink
Browse files

Synced gl4 branch with trunk.

git-svn-id: https://opentk.svn.sourceforge.net/svnroot/opentk/branches/gl4@3017 ebc5dd9b-fb1d-0410-b6f8-d24c324e9604
  • Loading branch information...
2 parents fca9b2b + eed2de1 commit 838e83887c4733e4a742132c0f63e85462aa3694 the_fiddler committed Dec 4, 2010
Showing with 7,995 additions and 2,982 deletions.
  1. +20 −0 QuickStart.sln
  2. +13 −29 Source/Bind/Generator.Bind.csproj
  3. +29 −1 Source/Build.UpdateVersion/Build.UpdateVersion.csproj
  4. +82 −8 Source/Build.UpdateVersion/Program.cs
  5. +0 −2 Source/Compatibility/Audio/OpenAL/AL/EffectsExtensionPresets.cs
  6. +0 −5 Source/Compatibility/Graphics/GL/GLHelper.cs
  7. +20 −7 Source/Compatibility/OpenTK.Compatibility.csproj
  8. +13 −29 Source/Converter/Generator.Convert.csproj
  9. +63 −38 Source/Examples/ExampleBrowser.cs
  10. +204 −0 Source/Examples/OpenGL/1.x/Anaglyph.cs
  11. BIN Source/Examples/OpenGL/1.x/Anaglyph.rtf
  12. +26 −36 Source/Examples/OpenGL/1.x/FramebufferObject.cs
  13. BIN Source/Examples/OpenGL/1.x/FramebufferObject.rtf
  14. +438 −0 Source/Examples/OpenGL/1.x/OpenGLDiagnostics.cs
  15. BIN Source/Examples/OpenGL/1.x/OpenGLDiagnostics.rtf
  16. +2 −2 Source/Examples/OpenGL/1.x/VBODynamic.cs
  17. +6 −6 Source/Examples/OpenGL/2.x/GeometryShaderAdvanced.cs
  18. +2 −2 Source/Examples/OpenGL/2.x/SimpleGLSL.cs
  19. +11 −1 Source/Examples/OpenTK.Examples.csproj
  20. +20 −1 Source/Examples/OpenTK/GLControl/GLControlGameLoop.cs
  21. +48 −46 Source/Examples/OpenTK/Test/BlittableValueTypes.cs
  22. +88 −7 Source/Examples/OpenTK/Test/GameWindowStates.cs
  23. +5 −1 Source/GLControl/OpenTK.GLControl.csproj
  24. +52 −6 Source/OpenTK/Audio/OpenAL/AL/AL.cs
  25. +66 −30 Source/OpenTK/DisplayDevice.cs
  26. +72 −0 Source/OpenTK/DisplayIndex.cs
  27. +17 −8 Source/OpenTK/GameWindow.cs
  28. +101 −11 Source/OpenTK/Graphics/ColorFormat.cs
  29. +58 −6 Source/OpenTK/Graphics/GraphicsContext.cs
  30. +2 −2 Source/OpenTK/Graphics/GraphicsMode.cs
  31. +63 −0 Source/OpenTK/Graphics/GraphicsModeComparer.cs
  32. +1 −1 Source/OpenTK/Graphics/OpenGL/GLHelper.cs
  33. +20 −4 Source/OpenTK/INativeWindow.cs
  34. +46 −0 Source/OpenTK/Input/ButtonState.cs
  35. +10 −0 Source/OpenTK/Input/IGamePadDriver.cs
  36. +41 −0 Source/OpenTK/Input/IInputDriver2.cs
  37. +1 −0 Source/OpenTK/Input/IJoystickDriver.cs
  38. +1 −0 Source/OpenTK/Input/IKeyboardDriver.cs
  39. +31 −0 Source/OpenTK/Input/IKeyboardDriver2.cs
  40. +1 −0 Source/OpenTK/Input/IMouseDriver.cs
  41. +40 −0 Source/OpenTK/Input/IMouseDriver2.cs
  42. +0 −126 Source/OpenTK/Input/InputDriver.cs
  43. +41 −18 Source/OpenTK/Input/Keyboard.cs
  44. +199 −19 Source/OpenTK/Input/KeyboardState.cs
  45. +39 −10 Source/OpenTK/Input/Mouse.cs
  46. +309 −5 Source/OpenTK/Input/MouseState.cs
  47. +49 −0 Source/OpenTK/IntPtrEqualityComparer.cs
  48. +2 −2 Source/OpenTK/Math/Box2.cs
  49. +0 −2 Source/OpenTK/Math/Matrix4.cs
  50. +0 −2 Source/OpenTK/Math/Matrix4d.cs
  51. +10 −0 Source/OpenTK/Math/Vector2.cs
  52. +10 −0 Source/OpenTK/Math/Vector2d.cs
  53. +20 −0 Source/OpenTK/Math/Vector2h.cs
  54. +12 −1 Source/OpenTK/Math/Vector3.cs
  55. +14 −3 Source/OpenTK/Math/Vector3d.cs
  56. +22 −0 Source/OpenTK/Math/Vector3h.cs
  57. +14 −0 Source/OpenTK/Math/Vector4.cs
  58. +14 −0 Source/OpenTK/Math/Vector4d.cs
  59. +24 −0 Source/OpenTK/Math/Vector4h.cs
  60. +96 −28 Source/OpenTK/NativeWindow.cs
  61. +23 −10 Source/OpenTK/OpenTK.csproj
  62. +53 −0 Source/OpenTK/Platform/DisplayDeviceBase.cs
  63. +12 −2 Source/OpenTK/Platform/Factory.cs
  64. +26 −6 Source/OpenTK/Platform/IDisplayDeviceDriver.cs
  65. +3 −1 Source/OpenTK/Platform/IPlatformFactory.cs
  66. +218 −209 Source/OpenTK/Platform/MacOS/AglContext.cs
  67. +76 −70 Source/OpenTK/Platform/MacOS/Application.cs
  68. +26 −5 Source/OpenTK/Platform/MacOS/CarbonBindings/Agl.cs
  69. +49 −6 Source/OpenTK/Platform/MacOS/CarbonBindings/CarbonAPI.cs
  70. +49 −0 Source/OpenTK/Platform/MacOS/CarbonBindings/CoreFoundation.cs
  71. +27 −0 Source/OpenTK/Platform/MacOS/CarbonBindings/MacOSKeys.cs
  72. +61 −1 Source/OpenTK/Platform/MacOS/CarbonBindings/QuartzDisplayServicesAPI.cs
  73. +27 −0 Source/OpenTK/Platform/MacOS/CarbonBindings/SpeechChannel.cs
  74. +552 −583 Source/OpenTK/Platform/MacOS/CarbonGLNative.cs
  75. +52 −1 Source/OpenTK/Platform/MacOS/CarbonInput.cs
  76. +19 −20 Source/OpenTK/Platform/MacOS/CarbonWindowInfo.cs
  77. +43 −20 Source/OpenTK/Platform/MacOS/EventInfo.cs
  78. +937 −0 Source/OpenTK/Platform/MacOS/HIDInput.cs
  79. +28 −0 Source/OpenTK/Platform/MacOS/MacOSException.cs
  80. +15 −3 Source/OpenTK/Platform/MacOS/MacOSFactory.cs
  81. +139 −7 Source/OpenTK/Platform/MacOS/MacOSGraphicsMode.cs
  82. +31 −2 Source/OpenTK/Platform/MacOS/MacOSKeyMap.cs
  83. +86 −75 Source/OpenTK/Platform/MacOS/QuartzDisplayDeviceDriver.cs
  84. +0 −1 Source/OpenTK/Platform/Utilities.cs
  85. +116 −74 Source/OpenTK/Platform/Windows/API.cs
  86. +111 −233 Source/OpenTK/Platform/Windows/WMInput.cs
  87. +9 −4 Source/OpenTK/Platform/Windows/WglHelper.cs
  88. +99 −54 Source/OpenTK/Platform/Windows/WinDisplayDevice.cs
  89. +31 −7 Source/OpenTK/Platform/Windows/WinFactory.cs
  90. +111 −95 Source/OpenTK/Platform/Windows/WinGLContext.cs
  91. +199 −125 Source/OpenTK/Platform/Windows/WinGLNative.cs
  92. +138 −137 Source/OpenTK/Platform/Windows/WinGraphicsMode.cs
  93. +203 −0 Source/OpenTK/Platform/Windows/WinInputBase.cs
  94. +95 −86 Source/OpenTK/Platform/Windows/WinKeyMap.cs
  95. +1 −1 Source/OpenTK/Platform/Windows/WinMMJoystick.cs
  96. +107 −175 Source/OpenTK/Platform/Windows/WinRawInput.cs
  97. +226 −191 Source/OpenTK/Platform/Windows/WinRawKeyboard.cs
  98. +203 −174 Source/OpenTK/Platform/Windows/WinRawMouse.cs
  99. +109 −1 Source/OpenTK/Platform/X11/API.cs
  100. +83 −4 Source/OpenTK/Platform/X11/Functions.cs
  101. +195 −0 Source/OpenTK/Platform/X11/Structs.cs
  102. +84 −31 Source/OpenTK/Platform/X11/X11DisplayDevice.cs
  103. +10 −2 Source/OpenTK/Platform/X11/X11Factory.cs
  104. +135 −61 Source/OpenTK/Platform/X11/X11GLNative.cs
  105. +1 −0 Source/OpenTK/Platform/X11/X11KeyMap.cs
  106. +125 −0 Source/OpenTK/Platform/X11/X11Keyboard.cs
  107. +152 −0 Source/OpenTK/Platform/X11/X11Mouse.cs
  108. +263 −0 Source/OpenTK/Platform/X11/XI2Mouse.cs
  109. +49 −0 Source/QuickStart/QuickStart.csproj
View
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickStart", "Source\QuickStart\QuickStart.csproj", "{90762BBE-CB23-42FF-9D3E-486D2F6CA485}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|AnyCPU = Debug|AnyCPU
+ Release|AnyCPU = Release|AnyCPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {90762BBE-CB23-42FF-9D3E-486D2F6CA485}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU
+ {90762BBE-CB23-42FF-9D3E-486D2F6CA485}.Debug|AnyCPU.Build.0 = Debug|Any CPU
+ {90762BBE-CB23-42FF-9D3E-486D2F6CA485}.Release|AnyCPU.ActiveCfg = Release|Any CPU
+ {90762BBE-CB23-42FF-9D3E-486D2F6CA485}.Release|AnyCPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ StartupItem = Source\QuickStart\QuickStart.csproj
+ EndGlobalSection
+EndGlobal
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<ProjectType>Local</ProjectType>
@@ -7,8 +7,6 @@
<ProjectGuid>{31D19132-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ApplicationIcon>
- </ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>Bind</AssemblyName>
@@ -21,8 +19,6 @@
<AppDesignerFolder>
</AppDesignerFolder>
<RootNamespace>Bind</RootNamespace>
- <StartupObject>
- </StartupObject>
<StartArguments>
</StartArguments>
<FileUpgradeFlags>
@@ -47,73 +43,60 @@
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>DEBUG;TRACE;</DefineConstants>
<DocumentationFile>
</DocumentationFile>
- <DebugSymbols>True</DebugSymbols>
+ <DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
- <Optimize>False</Optimize>
+ <Optimize>false</Optimize>
<OutputPath>..\..\Binaries\OpenTK\Debug\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
- <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
- <NoStdLib>False</NoStdLib>
- <NoWarn>
- </NoWarn>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;</DefineConstants>
<DocumentationFile>
</DocumentationFile>
- <DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
- <Optimize>True</Optimize>
+ <Optimize>true</Optimize>
<OutputPath>..\..\Binaries\OpenTK\Release\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
- <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
- <NoStdLib>False</NoStdLib>
- <NoWarn>
- </NoWarn>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <DebugType>none</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Nsis|AnyCPU'">
- <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
- <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;</DefineConstants>
<DocumentationFile>
</DocumentationFile>
- <DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
- <Optimize>True</Optimize>
+ <Optimize>true</Optimize>
<OutputPath>..\..\Binaries\OpenTK\Release\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
- <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
- <NoStdLib>False</NoStdLib>
- <NoWarn>
- </NoWarn>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <DebugType>none</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Documentation|AnyCPU'">
<OutputPath>..\..\Binaries\OpenTK\Release\</OutputPath>
+ <DebugType>none</DebugType>
+ <WarningLevel>4</WarningLevel>
+ <Optimize>true</Optimize>
+ <DefineConstants>TRACE;</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
@@ -1055,6 +1038,7 @@
</None>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?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>..\..\Binaries\OpenTK\Release</OutputPath>
@@ -26,17 +26,45 @@
<RootNamespace>Build.UpdateVersion</RootNamespace>
<OutputType>Exe</OutputType>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>10.0.0</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.cs" />
</ItemGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Documentation|AnyCPU' ">
+ <DebugType>none</DebugType>
+ <DefineConstants>TRACE;</DefineConstants>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>none</DebugType>
+ <DefineConstants>TRACE;</DefineConstants>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Nsis|AnyCPU' ">
+ <DebugType>none</DebugType>
+ <DefineConstants>TRACE;</DefineConstants>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
<Target Name="BeforeBuild">
<Delete Files="..\..\Version.txt" />
</Target>
@@ -26,20 +26,38 @@
#endregion
using System;
+using System.Diagnostics;
using System.IO;
namespace Build.UpdateVersion
{
- class Program
- {
+ class Program
+ {
const string Major = "1";
const string Minor = "1";
+ static string RootDirectory;
+ static string SourceDirectory;
+
public static void Main()
{
+ string wdir = Environment.CurrentDirectory;
+ if (Directory.GetParent(wdir).Name == "Source")
+ {
+ // Running through msbuild inside Source/Build.UpdateVersion/
+ RootDirectory = "../..";
+ SourceDirectory = "..";
+ }
+ else
+ {
+ // Running manually inside Binaries/OpenTK/[Debug|Release]/
+ RootDirectory = "../../..";
+ SourceDirectory = "../../../Source";
+ }
+
DateTime now = DateTime.UtcNow;
- GenerateVersionInfo(now, "../../Version.txt");
- GenerateAssemblyInfo(now, "../GlobalAssemblyInfo.cs");
+ GenerateVersionInfo(now, Path.Combine(RootDirectory, "Version.txt"));
+ GenerateAssemblyInfo(now, Path.Combine(SourceDirectory, "GlobalAssemblyInfo.cs"));
}
static void GenerateVersionInfo(DateTime now, string file)
@@ -54,7 +72,7 @@ static void GenerateVersionInfo(DateTime now, string file)
version = lines[0];
}
}
-
+
// If the file does not exist, create it.
if (version == null)
{
@@ -69,7 +87,9 @@ static void GenerateAssemblyInfo(DateTime now, string file)
// 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();
- string revision = ((int)((timespan - (int)timespan) * UInt16.MaxValue)).ToString();
+
+ string revision = RetrieveSvnRevision() ?? RetrieveBzrRevision() ?? RetrieveSeconds(timespan);
+ revision = revision.Trim();
File.WriteAllLines(file, new string[]
{
@@ -90,5 +110,59 @@ static void GenerateAssemblyInfo(DateTime now, string file)
String.Format("[assembly: AssemblyFileVersion(\"{0}.{1}.{2}.{3}\")]", Major, Minor, build, revision),
});
}
- }
-}
+
+ static string RetrieveSeconds(double timespan)
+ {
+ string revision = ((int)((timespan - (int)timespan) * UInt16.MaxValue)).ToString();
+ return revision;
+ }
+
+ static string RetrieveSvnRevision()
+ {
+ try
+ {
+ string output = RunProcess("svn", "info", RootDirectory);
+
+ const string RevisionText = "Revision: ";
+ int index = output.IndexOf(RevisionText);
+ if (index > -1)
+ return output.Substring(index + RevisionText.Length, 5)
+ .Replace('\r', ' ').Replace('\n', ' ').Trim();
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Failed to retrieve svn revision. Error: {0}", e);
+ }
+ return null;
+ }
+
+ static string RetrieveBzrRevision()
+ {
+ try
+ {
+ string output = RunProcess("bzr", "revno", RootDirectory);
+ return output != null && !output.StartsWith("bzr") ? output : null;
+ }
+ catch (Exception e)
+ {
+ Debug.Print("Failed to retrieve svn revision. Error: {0}", e);
+ }
+ return null;
+ }
+
+ static string RunProcess(string cmd, string args, string wdir)
+ {
+ ProcessStartInfo info = new ProcessStartInfo(cmd, args);
+ info.WorkingDirectory = wdir;
+ info.RedirectStandardOutput = true;
+ info.RedirectStandardError = true;
+ info.UseShellExecute = false;
+ Process p = new Process();
+ p.StartInfo = info;
+ p.Start();
+ p.WaitForExit();
+ string output = p.StandardOutput.ReadToEnd();
+ return output;
+ }
+ }
+}
@@ -363,7 +363,5 @@ public static class ReverbPresets
public static EaxReverb Chapel = new EaxReverb(26, 19.6f, 0.840f, -1000, -500, 0, 4.62f, 0.64f, 1.23f, -700, 0.032f, 0f, 0f, 0f, -200, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0.110f, -5f, 5000f, 250f, 0f, 0x3f);
public static EaxReverb Smallwaterroom = new EaxReverb(26, 36.2f, 0.700f, -1000, -698, 0, 1.51f, 1.25f, 1.14f, -100, 0.020f, 0f, 0f, 0f, 300, 0.030f, 0f, 0f, 0f, 0.179f, 0.150f, 0.895f, 0.190f, -7f, 5000f, 250f, 0f, 0x0);
}
-
-#pragma warning restore 1591
}
}
@@ -1312,11 +1312,6 @@ public static void TexEnv(TextureEnvTarget target, TextureEnvParameter pname, Co
#endregion
-#pragma warning restore 3019
-#pragma warning restore 1591
-#pragma warning restore 1572
-#pragma warning restore 1573
-
#endregion
}
}
Oops, something went wrong.

0 comments on commit 838e838

Please sign in to comment.