Merge pull request #524 from Nihlus/glwidget-gtk3

GTK3 updates for GLWidget
This commit is contained in:
varon 2017-07-04 21:35:21 +02:00 committed by GitHub
commit 8c66c332ab
12 changed files with 582 additions and 520 deletions

View file

@ -42,7 +42,7 @@ let tags = "OpenTK OpenGL OpenGLES GLES OpenAL C# F# VB .NET Mono Vector Math Ga
let copyright = "Copyright (c) 2006 - 2016 Stefanos Apostolopoulos <stapostol@gmail.com> for the Open Toolkit library." let copyright = "Copyright (c) 2006 - 2016 Stefanos Apostolopoulos <stapostol@gmail.com> for the Open Toolkit library."
// File system information // File system information
let solutionFile = "OpenTK.sln" let solutionFile = "OpenTK.sln"
// Pattern specifying assemblies to be tested using NUnit // Pattern specifying assemblies to be tested using NUnit
@ -50,7 +50,7 @@ let testAssemblies = "tests/**/bin/Release/*Tests*.dll"
// Git configuration (used for publishing documentation in gh-pages branch) // Git configuration (used for publishing documentation in gh-pages branch)
// The profile where the project is posted // The profile where the project is posted
let gitOwner = "opentk" let gitOwner = "opentk"
let gitHome = "https://github.com/" + gitOwner let gitHome = "https://github.com/" + gitOwner
// The name of the project on GitHub // The name of the project on GitHub
@ -70,7 +70,7 @@ let isXamarinPlatform = false //EnvironmentHelper.isMacOS || Environment.OSVersi
// Helper active pattern for project types // Helper active pattern for project types
let (|Fsproj|Csproj|Vbproj|) (projFileName:string) = let (|Fsproj|Csproj|Vbproj|) (projFileName:string) =
match projFileName with match projFileName with
| f when f.EndsWith "fsproj" -> Fsproj | f when f.EndsWith "fsproj" -> Fsproj
| f when f.EndsWith "csproj" -> Csproj | f when f.EndsWith "csproj" -> Csproj
@ -78,24 +78,23 @@ let (|Fsproj|Csproj|Vbproj|) (projFileName:string) =
| _ -> failwith (sprintf "Project file %s not supported. Unknown project type." projFileName) | _ -> failwith (sprintf "Project file %s not supported. Unknown project type." projFileName)
let activeProjects = let activeProjects =
let xamarinFilter f = let xamarinFilter f =
if isXamarinPlatform then if isXamarinPlatform then
f f
else else
f f
-- "**/OpenTK.Android.csproj" -- "**/OpenTK.Android.csproj"
-- "**/OpenTK.iOS.csproj" -- "**/OpenTK.iOS.csproj"
!! "src/**/*.??proj" !! "src/**/*.??proj"
++ "tests/**/OpenTK.Tests.fsproj" ++ "tests/**/OpenTK.Tests.fsproj"
-- "**/OpenTK.GLWidget.csproj"
|> xamarinFilter |> xamarinFilter
// Generate assembly info files with the right version & up-to-date information // Generate assembly info files with the right version & up-to-date information
Target "AssemblyInfo" (fun _ -> Target "AssemblyInfo" (fun _ ->
let getAssemblyInfoAttributes (projectName:string) = let getAssemblyInfoAttributes (projectName:string) =
let projectName = let projectName =
if projectName.Contains(".iOS") || projectName.Contains(".Android") then if projectName.Contains(".iOS") || projectName.Contains(".Android") then
projectName.Split('.').[0] projectName.Split('.').[0]
else else
@ -110,7 +109,7 @@ Target "AssemblyInfo" (fun _ ->
let getProjectDetails projectPath = let getProjectDetails projectPath =
let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath) let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath)
( projectPath, ( projectPath,
projectName, projectName,
System.IO.Path.GetDirectoryName(projectPath), System.IO.Path.GetDirectoryName(projectPath),
(getAssemblyInfoAttributes projectName) (getAssemblyInfoAttributes projectName)
@ -127,7 +126,7 @@ Target "AssemblyInfo" (fun _ ->
) )
// Copies binaries from default VS location to expected bin folder // Copies binaries from default VS location to expected bin folder
// But keeps a subdirectory structure for each project in the // But keeps a subdirectory structure for each project in the
// src folder to support multiple project outputs // src folder to support multiple project outputs
Target "CopyBinaries" (fun _ -> Target "CopyBinaries" (fun _ ->
activeProjects activeProjects
@ -175,7 +174,7 @@ Target "NuGet" (fun _ ->
"OpenTK.iOS" ] "OpenTK.iOS" ]
Paket.Pack(fun p -> Paket.Pack(fun p ->
{ p with { p with
OutputPath = "bin" OutputPath = "bin"
ExcludedTemplates = "OpenTK.GLWidget" :: xamExcludes ExcludedTemplates = "OpenTK.GLWidget" :: xamExcludes
@ -198,7 +197,7 @@ Target "All" DoNothing
==> "RunTests" ==> "RunTests"
==> "All" ==> "All"
"All" "All"
==> "NuGet" ==> "NuGet"

View file

@ -9,4 +9,4 @@ nuget xunit.runner.console
nuget xunit.assert nuget xunit.assert
nuget FAKE nuget FAKE
nuget Mono.Cecil >= 0.10.0-beta1 nuget Mono.Cecil >= 0.10.0-beta1
nuget GtkSharp nuget gtk-sharp3

View file

@ -1,6 +1,6 @@
NUGET NUGET
remote: https://www.nuget.org/api/v2 remote: https://www.nuget.org/api/v2
FAKE (4.61.2) FAKE (4.61.3)
FsCheck (2.9) FsCheck (2.9)
FSharp.Core (>= 4.1) - framework: >= net10, netstandard10, netstandard11, netstandard12, netstandard13, netstandard14, netstandard15 FSharp.Core (>= 4.1) - framework: >= net10, netstandard10, netstandard11, netstandard12, netstandard13, netstandard14, netstandard15
FSharp.Core (>= 4.1.17) - framework: >= netstandard16 FSharp.Core (>= 4.1.17) - framework: >= netstandard16
@ -13,39 +13,39 @@ NUGET
xunit.core (>= 2.2) - framework: >= netstandard16 xunit.core (>= 2.2) - framework: >= netstandard16
xunit.extensibility.execution (>= 2.2 < 3.0) - framework: >= net10, netstandard10, netstandard11, netstandard12, netstandard13, netstandard14, netstandard15 xunit.extensibility.execution (>= 2.2 < 3.0) - framework: >= net10, netstandard10, netstandard11, netstandard12, netstandard13, netstandard14, netstandard15
FSharp.Compiler.Service (2.0.0.6) FSharp.Compiler.Service (2.0.0.6)
FSharp.Core (4.1.17) - framework: >= net10, >= netstandard10 FSharp.Core (4.2.1) - framework: >= net10, >= netstandard10
System.Collections (>= 4.0.11) - framework: >= netstandard16 System.Collections (>= 4.0.11) - framework: >= net463, >= netstandard16
System.Console (>= 4.0) - framework: >= netstandard16 System.Console (>= 4.0) - framework: >= net463, >= netstandard16
System.Diagnostics.Debug (>= 4.0.11) - framework: >= netstandard16 System.Diagnostics.Debug (>= 4.0.11) - framework: >= net463, >= netstandard16
System.Diagnostics.Tools (>= 4.0.1) - framework: >= netstandard16 System.Diagnostics.Tools (>= 4.0.1) - framework: >= net463, >= netstandard16
System.Globalization (>= 4.0.11) - framework: >= netstandard16 System.Globalization (>= 4.0.11) - framework: >= net463, >= netstandard16
System.IO (>= 4.1) - framework: >= netstandard16 System.IO (>= 4.1) - framework: >= net463, >= netstandard16
System.Linq (>= 4.1) - framework: >= netstandard16 System.Linq (>= 4.1) - framework: >= net463, >= netstandard16
System.Linq.Expressions (>= 4.1) - framework: >= netstandard16 System.Linq.Expressions (>= 4.1) - framework: >= net463, >= netstandard16
System.Linq.Queryable (>= 4.0.1) - framework: >= netstandard16 System.Linq.Queryable (>= 4.0.1) - framework: >= net463, >= netstandard16
System.Net.Requests (>= 4.0.11) - framework: >= netstandard16 System.Net.Requests (>= 4.0.11) - framework: >= net463, >= netstandard16
System.Reflection (>= 4.1) - framework: >= netstandard16 System.Reflection (>= 4.1) - framework: >= net463, >= netstandard16
System.Reflection.Extensions (>= 4.0.1) - framework: >= netstandard16 System.Reflection.Extensions (>= 4.0.1) - framework: >= net463, >= netstandard16
System.Resources.ResourceManager (>= 4.0.1) - framework: >= netstandard16 System.Resources.ResourceManager (>= 4.0.1) - framework: >= net463, >= netstandard16
System.Runtime (>= 4.1) - framework: >= netstandard16 System.Runtime (>= 4.1) - framework: >= net463, >= netstandard16
System.Runtime.Extensions (>= 4.1) - framework: >= netstandard16 System.Runtime.Extensions (>= 4.1) - framework: >= net463, >= netstandard16
System.Runtime.Numerics (>= 4.0.1) - framework: >= netstandard16 System.Runtime.Numerics (>= 4.0.1) - framework: >= net463, >= netstandard16
System.Text.RegularExpressions (>= 4.1) - framework: >= netstandard16 System.Text.RegularExpressions (>= 4.1) - framework: >= net463, >= netstandard16
System.Threading (>= 4.0.11) - framework: >= netstandard16 System.Threading (>= 4.0.11) - framework: >= net463, >= netstandard16
System.Threading.Tasks (>= 4.0.11) - framework: >= netstandard16 System.Threading.Tasks (>= 4.0.11) - framework: >= net463, >= netstandard16
System.Threading.Tasks.Parallel (>= 4.0.1) - framework: >= netstandard16 System.Threading.Tasks.Parallel (>= 4.0.1) - framework: >= net463, >= netstandard16
System.Threading.Thread (>= 4.0) - framework: >= netstandard16 System.Threading.Thread (>= 4.0) - framework: >= net463, >= netstandard16
System.Threading.ThreadPool (>= 4.0.10) - framework: >= netstandard16 System.Threading.ThreadPool (>= 4.0.10) - framework: >= net463, >= netstandard16
System.Threading.Timer (>= 4.0.1) - framework: >= netstandard16 System.Threading.Timer (>= 4.0.1) - framework: >= net463, >= netstandard16
FSharp.Formatting (2.14.4) FSharp.Formatting (2.14.4)
FSharp.Compiler.Service (2.0.0.6) FSharp.Compiler.Service (2.0.0.6)
FSharpVSPowerTools.Core (>= 2.3 < 2.4) FSharpVSPowerTools.Core (>= 2.3 < 2.4)
FSharpVSPowerTools.Core (2.3) FSharpVSPowerTools.Core (2.3)
FSharp.Compiler.Service (>= 2.0.0.3) FSharp.Compiler.Service (>= 2.0.0.3)
GtkSharp (3.1.3) gtk-sharp3 (3.22)
Microsoft.NETCore.Platforms (1.1) - framework: >= net10, >= netstandard11, netstandard12, netstandard13, netstandard14, netstandard15 Microsoft.NETCore.Platforms (1.1) - framework: >= net10, >= netstandard11, netstandard12, netstandard13, netstandard14, netstandard15
Microsoft.NETCore.Targets (1.1) - framework: >= net10, >= netstandard11, netstandard12, netstandard13, netstandard14, netstandard15 Microsoft.NETCore.Targets (1.1) - framework: >= net10, >= netstandard11, netstandard12, netstandard13, netstandard14, netstandard15
Microsoft.Win32.Primitives (4.3) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 Microsoft.Win32.Primitives (4.3) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13
Microsoft.NETCore.Targets (>= 1.1) - framework: >= netstandard13 Microsoft.NETCore.Targets (>= 1.1) - framework: >= netstandard13
System.Runtime (>= 4.3) - framework: >= netstandard13 System.Runtime (>= 4.3) - framework: >= netstandard13
@ -103,21 +103,21 @@ NUGET
System.Threading.Timer (>= 4.3) - framework: >= net451, >= netstandard12 System.Threading.Timer (>= 4.3) - framework: >= net451, >= netstandard12
System.Xml.ReaderWriter (>= 4.3) - framework: >= netstandard10 System.Xml.ReaderWriter (>= 4.3) - framework: >= netstandard10
System.Xml.XDocument (>= 4.3) - framework: >= netstandard10 System.Xml.XDocument (>= 4.3) - framework: >= netstandard10
runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
runtime.native.System (4.3) - framework: >= net10, >= netstandard11, netstandard12, netstandard13, netstandard14, netstandard15 runtime.native.System (4.3) - framework: >= net45, >= netstandard11, netstandard12, netstandard13, netstandard14, netstandard15
Microsoft.NETCore.Platforms (>= 1.1) Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1) Microsoft.NETCore.Targets (>= 1.1)
runtime.native.System.IO.Compression (4.3) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 runtime.native.System.IO.Compression (4.3) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
Microsoft.NETCore.Platforms (>= 1.1) Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1) Microsoft.NETCore.Targets (>= 1.1)
runtime.native.System.Net.Http (4.3) - framework: >= net10, >= netstandard16 runtime.native.System.Net.Http (4.3) - framework: >= net45, >= netstandard16
Microsoft.NETCore.Platforms (>= 1.1) Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1) Microsoft.NETCore.Targets (>= 1.1)
runtime.native.System.Security.Cryptography.Apple (4.3) - framework: >= net10, >= netstandard16 runtime.native.System.Security.Cryptography.Apple (4.3) - framework: >= net45, >= netstandard16
runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple (>= 4.3) runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple (>= 4.3)
runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1) runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1)
runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1) runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1)
runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1) runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1)
@ -128,17 +128,17 @@ NUGET
runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1) runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1)
runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1) runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1)
runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1) runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.1)
runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple (4.3) - framework: >= net10, >= netstandard16 runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple (4.3) - framework: >= net45, >= netstandard16
runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.1) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
System.AppContext (4.3) - framework: >= net46, >= netstandard13, netstandard14, netstandard15 System.AppContext (4.3) - framework: >= net46, >= netstandard13, netstandard14, netstandard15
System.Runtime (>= 4.3) - framework: dnxcore50, netstandard13, >= netstandard16 System.Runtime (>= 4.3) - framework: dnxcore50, netstandard13, >= netstandard16
System.Buffers (4.3) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 System.Buffers (4.3) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
System.Diagnostics.Debug (>= 4.3) - framework: >= netstandard11 System.Diagnostics.Debug (>= 4.3) - framework: >= netstandard11
System.Diagnostics.Tracing (>= 4.3) - framework: >= netstandard11 System.Diagnostics.Tracing (>= 4.3) - framework: >= netstandard11
System.Resources.ResourceManager (>= 4.3) - framework: >= netstandard11 System.Resources.ResourceManager (>= 4.3) - framework: >= netstandard11
@ -148,7 +148,7 @@ NUGET
Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13 Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13
Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13 Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13
System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13
System.Collections.Concurrent (4.3) - framework: >= net10, >= netstandard11, netstandard12, netstandard13, netstandard14, netstandard15 System.Collections.Concurrent (4.3) - framework: >= net45, >= netstandard11, netstandard12, netstandard13, netstandard14, netstandard15
System.Collections (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Collections (>= 4.3) - framework: dnxcore50, >= netstandard13
System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard13
System.Diagnostics.Tracing (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Diagnostics.Tracing (>= 4.3) - framework: dnxcore50, >= netstandard13
@ -159,7 +159,7 @@ NUGET
System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13
System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard13
System.Threading.Tasks (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13 System.Threading.Tasks (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13
System.Console (4.3) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 System.Console (4.3) - framework: >= net46, >= netstandard13, netstandard14, netstandard15
Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13
Microsoft.NETCore.Targets (>= 1.1) - framework: >= netstandard13 Microsoft.NETCore.Targets (>= 1.1) - framework: >= netstandard13
System.IO (>= 4.3) - framework: >= netstandard13 System.IO (>= 4.3) - framework: >= netstandard13
@ -169,7 +169,7 @@ NUGET
Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13 Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13
Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13 Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, >= netstandard13
System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13
System.Diagnostics.DiagnosticSource (4.3.1) - framework: >= net10, netstandard13, >= netstandard16 System.Diagnostics.DiagnosticSource (4.3.1) - framework: >= net45, netstandard13, >= netstandard16
System.Collections (>= 4.3) - framework: netstandard11, >= netstandard13 System.Collections (>= 4.3) - framework: netstandard11, >= netstandard13
System.Diagnostics.Tracing (>= 4.3) - framework: netstandard11, >= netstandard13 System.Diagnostics.Tracing (>= 4.3) - framework: netstandard11, >= netstandard13
System.Reflection (>= 4.3) - framework: netstandard11, >= netstandard13 System.Reflection (>= 4.3) - framework: netstandard11, >= netstandard13
@ -179,7 +179,7 @@ NUGET
Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, >= netstandard10 Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, >= netstandard10
Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, >= netstandard10 Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, >= netstandard10
System.Runtime (>= 4.3) - framework: dnxcore50, >= netstandard10 System.Runtime (>= 4.3) - framework: dnxcore50, >= netstandard10
System.Diagnostics.Tracing (4.3) - framework: >= net10, >= netstandard11, netstandard12, netstandard13, netstandard14, netstandard15 System.Diagnostics.Tracing (4.3) - framework: >= net45, >= netstandard11, netstandard12, netstandard13, netstandard14, netstandard15
Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard11, netstandard12, netstandard13, >= netstandard15 Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard11, netstandard12, netstandard13, >= netstandard15
Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard11, netstandard12, netstandard13, >= netstandard15 Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard11, netstandard12, netstandard13, >= netstandard15
System.Runtime (>= 4.3) - framework: dnxcore50, netstandard11, netstandard12, netstandard13, >= netstandard15 System.Runtime (>= 4.3) - framework: dnxcore50, netstandard11, netstandard12, netstandard13, >= netstandard15
@ -192,7 +192,7 @@ NUGET
Microsoft.NETCore.Targets (>= 1.1) - framework: >= netstandard13 Microsoft.NETCore.Targets (>= 1.1) - framework: >= netstandard13
System.Globalization (>= 4.3) - framework: >= netstandard13 System.Globalization (>= 4.3) - framework: >= netstandard13
System.Runtime (>= 4.3) - framework: >= netstandard13 System.Runtime (>= 4.3) - framework: >= netstandard13
System.Globalization.Extensions (4.3) - framework: >= net10, >= netstandard16 System.Globalization.Extensions (4.3) - framework: >= net45, >= netstandard16
Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13
System.Globalization (>= 4.3) - framework: >= netstandard13 System.Globalization (>= 4.3) - framework: >= netstandard13
System.Resources.ResourceManager (>= 4.3) - framework: >= netstandard13 System.Resources.ResourceManager (>= 4.3) - framework: >= netstandard13
@ -205,7 +205,7 @@ NUGET
System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15
System.Text.Encoding (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 System.Text.Encoding (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15
System.Threading.Tasks (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15 System.Threading.Tasks (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard15
System.IO.Compression (4.3) - framework: >= net10, >= netstandard11, netstandard12, netstandard13, netstandard14, netstandard15 System.IO.Compression (4.3) - framework: >= net45, >= netstandard11, netstandard12, netstandard13, netstandard14, netstandard15
Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13
runtime.native.System (>= 4.3) - framework: >= netstandard13 runtime.native.System (>= 4.3) - framework: >= netstandard13
runtime.native.System.IO.Compression (>= 4.3) - framework: dnxcore50, >= netstandard13 runtime.native.System.IO.Compression (>= 4.3) - framework: dnxcore50, >= netstandard13
@ -266,7 +266,7 @@ NUGET
System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard16 System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, netstandard13, >= netstandard16
System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard16 System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard16
System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard16 System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard16
System.Linq.Queryable (4.3) - framework: >= net10, >= netstandard16 System.Linq.Queryable (4.3) - framework: >= net463, >= netstandard16
System.Collections (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Collections (>= 4.3) - framework: dnxcore50, >= netstandard13
System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard13
System.Linq (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 System.Linq (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13
@ -275,7 +275,7 @@ NUGET
System.Reflection.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Reflection.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13
System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard13
System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13 System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, >= netstandard13
System.Net.Http (4.3.2) - framework: >= net10, >= netstandard11, netstandard12, netstandard13, netstandard14, netstandard15 System.Net.Http (4.3.2) - framework: >= net45, >= netstandard11, netstandard12, netstandard13, netstandard14, netstandard15
Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard13, >= netstandard16 Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, netstandard13, >= netstandard16
Microsoft.Win32.Primitives (>= 4.3) - framework: netstandard13 Microsoft.Win32.Primitives (>= 4.3) - framework: netstandard13
runtime.native.System (>= 4.3) - framework: >= netstandard16 runtime.native.System (>= 4.3) - framework: >= netstandard16
@ -309,7 +309,7 @@ NUGET
Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, netstandard11, >= netstandard13 Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, netstandard10, netstandard11, >= netstandard13
System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, netstandard11, >= netstandard13 System.Runtime (>= 4.3) - framework: dnxcore50, netstandard10, netstandard11, >= netstandard13
System.Runtime.Handles (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Runtime.Handles (>= 4.3) - framework: dnxcore50, >= netstandard13
System.Net.Requests (4.3) - framework: >= net10, >= netstandard16 System.Net.Requests (4.3) - framework: >= net463, >= netstandard16
Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13
System.Collections (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Collections (>= 4.3) - framework: dnxcore50, >= netstandard13
System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard13
@ -330,7 +330,7 @@ NUGET
System.Net.Primitives (>= 4.3) - framework: >= netstandard13 System.Net.Primitives (>= 4.3) - framework: >= netstandard13
System.Runtime (>= 4.3) - framework: >= netstandard13 System.Runtime (>= 4.3) - framework: >= netstandard13
System.Threading.Tasks (>= 4.3) - framework: >= netstandard13 System.Threading.Tasks (>= 4.3) - framework: >= netstandard13
System.Net.WebHeaderCollection (4.3) - framework: >= net10, >= netstandard16 System.Net.WebHeaderCollection (4.3) - framework: >= net463, >= netstandard16
System.Collections (>= 4.3) - framework: >= netstandard13 System.Collections (>= 4.3) - framework: >= netstandard13
System.Resources.ResourceManager (>= 4.3) - framework: >= netstandard13 System.Resources.ResourceManager (>= 4.3) - framework: >= netstandard13
System.Runtime (>= 4.3) - framework: >= netstandard13 System.Runtime (>= 4.3) - framework: >= netstandard13
@ -406,12 +406,12 @@ NUGET
System.Runtime (>= 4.3) - framework: dnxcore50, >= netstandard11 System.Runtime (>= 4.3) - framework: dnxcore50, >= netstandard11
System.Runtime.InteropServices (>= 4.3) - framework: >= netstandard11 System.Runtime.InteropServices (>= 4.3) - framework: >= netstandard11
System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard11 System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard11
System.Runtime.Numerics (4.3) - framework: >= net10, >= netstandard11, netstandard12, netstandard13, netstandard14, netstandard15 System.Runtime.Numerics (4.3) - framework: >= net45, >= netstandard11, netstandard12, netstandard13, netstandard14, netstandard15
System.Globalization (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Globalization (>= 4.3) - framework: dnxcore50, >= netstandard13
System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Resources.ResourceManager (>= 4.3) - framework: dnxcore50, >= netstandard13
System.Runtime (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13 System.Runtime (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13
System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13
System.Security.Cryptography.Algorithms (4.3) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 System.Security.Cryptography.Algorithms (4.3) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, >= netstandard16 Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, >= netstandard16
runtime.native.System.Security.Cryptography.Apple (>= 4.3) - framework: >= netstandard16 runtime.native.System.Security.Cryptography.Apple (>= 4.3) - framework: >= netstandard16
runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - framework: >= netstandard16 runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - framework: >= netstandard16
@ -452,7 +452,7 @@ NUGET
System.Security.Cryptography.Primitives (>= 4.3) - framework: >= net46, >= netstandard13 System.Security.Cryptography.Primitives (>= 4.3) - framework: >= net46, >= netstandard13
System.Text.Encoding (>= 4.3) - framework: >= netstandard13 System.Text.Encoding (>= 4.3) - framework: >= netstandard13
System.Threading (>= 4.3) - framework: >= netstandard13 System.Threading (>= 4.3) - framework: >= netstandard13
System.Security.Cryptography.Encoding (4.3) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 System.Security.Cryptography.Encoding (4.3) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13 Microsoft.NETCore.Platforms (>= 1.1) - framework: >= netstandard13
runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - framework: >= netstandard13 runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - framework: >= netstandard13
System.Collections (>= 4.3) - framework: >= netstandard13 System.Collections (>= 4.3) - framework: >= netstandard13
@ -465,7 +465,7 @@ NUGET
System.Runtime.InteropServices (>= 4.3) - framework: >= netstandard13 System.Runtime.InteropServices (>= 4.3) - framework: >= netstandard13
System.Security.Cryptography.Primitives (>= 4.3) - framework: >= netstandard13 System.Security.Cryptography.Primitives (>= 4.3) - framework: >= netstandard13
System.Text.Encoding (>= 4.3) - framework: >= netstandard13 System.Text.Encoding (>= 4.3) - framework: >= netstandard13
System.Security.Cryptography.OpenSsl (4.3) - framework: >= net10, >= netstandard16 System.Security.Cryptography.OpenSsl (4.3) - framework: >= net45, >= netstandard16
runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - framework: >= net463, >= netstandard16, monoandroid, monotouch, xamarinios, xamarinmac runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3) - framework: >= net463, >= netstandard16, monoandroid, monotouch, xamarinios, xamarinmac
System.Collections (>= 4.3) - framework: >= netstandard16 System.Collections (>= 4.3) - framework: >= netstandard16
System.IO (>= 4.3) - framework: >= net463, >= netstandard16 System.IO (>= 4.3) - framework: >= net463, >= netstandard16
@ -479,7 +479,7 @@ NUGET
System.Security.Cryptography.Encoding (>= 4.3) - framework: >= net463, >= netstandard16 System.Security.Cryptography.Encoding (>= 4.3) - framework: >= net463, >= netstandard16
System.Security.Cryptography.Primitives (>= 4.3) - framework: >= net463, >= netstandard16 System.Security.Cryptography.Primitives (>= 4.3) - framework: >= net463, >= netstandard16
System.Text.Encoding (>= 4.3) - framework: >= netstandard16 System.Text.Encoding (>= 4.3) - framework: >= netstandard16
System.Security.Cryptography.Primitives (4.3) - framework: >= net10, >= netstandard13, netstandard14, netstandard15 System.Security.Cryptography.Primitives (4.3) - framework: >= net45, >= netstandard13, netstandard14, netstandard15
System.Diagnostics.Debug (>= 4.3) - framework: >= netstandard13 System.Diagnostics.Debug (>= 4.3) - framework: >= netstandard13
System.Globalization (>= 4.3) - framework: >= netstandard13 System.Globalization (>= 4.3) - framework: >= netstandard13
System.IO (>= 4.3) - framework: >= netstandard13 System.IO (>= 4.3) - framework: >= netstandard13
@ -540,7 +540,7 @@ NUGET
System.Collections (>= 4.3) - framework: >= netstandard10 System.Collections (>= 4.3) - framework: >= netstandard10
System.Runtime (>= 4.3) - framework: >= netstandard10 System.Runtime (>= 4.3) - framework: >= netstandard10
System.Threading.Tasks (>= 4.3) - framework: >= netstandard10 System.Threading.Tasks (>= 4.3) - framework: >= netstandard10
System.Threading.Tasks.Parallel (4.3) - framework: >= net10, >= netstandard16 System.Threading.Tasks.Parallel (4.3) - framework: >= net463, >= netstandard16
System.Collections.Concurrent (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13 System.Collections.Concurrent (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13
System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Diagnostics.Debug (>= 4.3) - framework: dnxcore50, >= netstandard13
System.Diagnostics.Tracing (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Diagnostics.Tracing (>= 4.3) - framework: dnxcore50, >= netstandard13
@ -549,12 +549,12 @@ NUGET
System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Runtime.Extensions (>= 4.3) - framework: dnxcore50, >= netstandard13
System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard13 System.Threading (>= 4.3) - framework: dnxcore50, >= netstandard13
System.Threading.Tasks (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13 System.Threading.Tasks (>= 4.3) - framework: dnxcore50, netstandard11, >= netstandard13
System.Threading.Thread (4.3) - framework: >= net10, >= netstandard16 System.Threading.Thread (4.3) - framework: >= net463, >= netstandard16
System.Runtime (>= 4.3) - framework: >= netstandard13 System.Runtime (>= 4.3) - framework: >= netstandard13
System.Threading.ThreadPool (4.3) - framework: >= net10, >= netstandard16 System.Threading.ThreadPool (4.3) - framework: >= net463, >= netstandard16
System.Runtime (>= 4.3) - framework: >= netstandard13 System.Runtime (>= 4.3) - framework: >= netstandard13
System.Runtime.Handles (>= 4.3) - framework: >= netstandard13 System.Runtime.Handles (>= 4.3) - framework: >= netstandard13
System.Threading.Timer (4.3) - framework: >= net10, >= netstandard12, netstandard13, netstandard14, netstandard15 System.Threading.Timer (4.3) - framework: >= net451, >= netstandard12, netstandard13, netstandard14, netstandard15
Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, >= netstandard12 Microsoft.NETCore.Platforms (>= 1.1) - framework: dnxcore50, >= netstandard12
Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, >= netstandard12 Microsoft.NETCore.Targets (>= 1.1) - framework: dnxcore50, >= netstandard12
System.Runtime (>= 4.3) - framework: dnxcore50, >= netstandard12 System.Runtime (>= 4.3) - framework: dnxcore50, >= netstandard12

View file

@ -1,104 +1,100 @@
#region License using System;
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2009 the Open Toolkit library, except where noted.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Security;
using System.Threading; using System.Threading;
using System.ComponentModel; using System.ComponentModel;
using OpenTK.Graphics; using OpenTK.Graphics;
using OpenTK.Platform; using OpenTK.Platform;
using OpenTK;
using Gtk; using Gtk;
using OpenTK.OSX;
using OpenTK.Win;
using OpenTK.X11;
namespace OpenTK namespace OpenTK
{ {
/// <summary>
/// The <see cref="GLWidget"/> is a GTK widget for which an OpenGL context can be used to draw arbitrary graphics.
/// </summary>
[ToolboxItem(true)] [ToolboxItem(true)]
public class GLWidget: DrawingArea, IDisposable public class GLWidget: DrawingArea
{ {
#region Static attrs. #region Static attrs.
static int _GraphicsContextCount; private static int _GraphicsContextCount;
static bool _SharedContextInitialized = false; private static bool _SharedContextInitialized = false;
#endregion #endregion
#region Attributes #region Attributes
IGraphicsContext _GraphicsContext; private IGraphicsContext _GraphicsContext;
IWindowInfo _WindowInfo; private IWindowInfo _WindowInfo;
GraphicsContextFlags _GraphicsContextFlags; private GraphicsContextFlags _GraphicsContextFlags;
bool _Initialized = false; private bool _Initialized = false;
#endregion #endregion
#region Properties #region Properties
/// <summary>Use a single buffer versus a double buffer.</summary> /// <summary>
/// Use a single buffer versus a double buffer.
/// </summary>
[Browsable(true)] [Browsable(true)]
public bool SingleBuffer { get; set; } public bool SingleBuffer { get; set; }
/// <summary>Color Buffer Bits-Per-Pixel</summary> /// <summary>
/// Color Buffer Bits-Per-Pixel
/// </summary>
public int ColorBPP { get; set; } public int ColorBPP { get; set; }
/// <summary>Accumulation Buffer Bits-Per-Pixel</summary> /// <summary>
/// Accumulation Buffer Bits-Per-Pixel
/// </summary>
public int AccumulatorBPP { get; set; } public int AccumulatorBPP { get; set; }
/// <summary>Depth Buffer Bits-Per-Pixel</summary> /// <summary>
/// Depth Buffer Bits-Per-Pixel
/// </summary>
public int DepthBPP { get; set; } public int DepthBPP { get; set; }
/// <summary>Stencil Buffer Bits-Per-Pixel</summary> /// <summary>
/// Stencil Buffer Bits-Per-Pixel
/// </summary>
public int StencilBPP { get; set; } public int StencilBPP { get; set; }
/// <summary>Number of samples</summary> /// <summary>
/// Number of samples
/// </summary>
public int Samples { get; set; } public int Samples { get; set; }
/// <summary>Indicates if steropic renderering is enabled</summary> /// <summary>
/// Indicates if steropic renderering is enabled
/// </summary>
public bool Stereo { get; set; } public bool Stereo { get; set; }
/// <summary>The major version of OpenGL to use.</summary> /// <summary>
/// The major version of OpenGL to use.
/// </summary>
public int GlVersionMajor { get; set; } public int GlVersionMajor { get; set; }
/// <summary>The minor version of OpenGL to use.</summary> /// <summary>
/// The minor version of OpenGL to use.
/// </summary>
public int GlVersionMinor { get; set; } public int GlVersionMinor { get; set; }
/// <summary>
/// The set <see cref="GraphicsContextFlags"/> for this widget.
/// </summary>
public GraphicsContextFlags GraphicsContextFlags public GraphicsContextFlags GraphicsContextFlags
{ {
get get
{ {
return _GraphicsContextFlags; return _GraphicsContextFlags;
} }
set set
{ {
_GraphicsContextFlags = value; _GraphicsContextFlags = value;
} }
} }
@ -106,19 +102,29 @@ namespace OpenTK
#region Construction/Destruction #region Construction/Destruction
/// <summary>Constructs a new GLWidget.</summary> /// <summary>
/// Initializes a new instance of the <see cref="GLWidget"/> class.
/// </summary>
public GLWidget() public GLWidget()
: this(GraphicsMode.Default) : this(GraphicsMode.Default)
{ {
} }
/// <summary>Constructs a new GLWidget using a given GraphicsMode</summary> /// <summary>Constructs a new GLWidget using a given GraphicsMode</summary>
public GLWidget(GraphicsMode graphicsMode) public GLWidget(GraphicsMode graphicsMode)
: this(graphicsMode, 1, 0, GraphicsContextFlags.Default) : this(graphicsMode, 1, 0, GraphicsContextFlags.Default)
{ {
} }
/// <summary>Constructs a new GLWidget</summary> /// <summary>
/// Initializes a new instance of the <see cref="GLWidget"/> class.
/// </summary>
/// <param name="graphicsMode">The <see cref="GraphicsMode"/> which the widget should be constructed with.</param>
/// <param name="glVersionMajor">The major OpenGL version to attempt to initialize.</param>
/// <param name="glVersionMinor">The minor OpenGL version to attempt to initialize.</param>
/// <param name="graphicsContextFlags">
/// Any flags which should be used during initialization of the <see cref="GraphicsContext"/>.
/// </param>
public GLWidget(GraphicsMode graphicsMode, int glVersionMajor, int glVersionMinor, GraphicsContextFlags graphicsContextFlags) public GLWidget(GraphicsMode graphicsMode, int glVersionMajor, int glVersionMinor, GraphicsContextFlags graphicsContextFlags)
{ {
this.DoubleBuffered = false; this.DoubleBuffered = false;
@ -136,28 +142,55 @@ namespace OpenTK
GraphicsContextFlags = graphicsContextFlags; GraphicsContextFlags = graphicsContextFlags;
} }
/// <summary>
/// Destructs this object.
/// </summary>
~GLWidget() ~GLWidget()
{ {
Dispose(false); Dispose(false);
} }
#if GTK3 /// <summary>
public override void Destroy() { /// Destroys this <see cref="Widget"/>, disposing it and destroying it in the context of GTK.
#else /// </summary>
public override void Dispose() public override void Destroy()
{ {
#endif
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
Dispose(true); Dispose(true);
#if GTK3
base.Destroy(); base.Destroy();
#else
base.Dispose();
#endif
} }
#if !GTK3
/// <summary>
/// Disposes the current object, releasing any native resources it was using.
/// </summary>
/// <param name="disposing"></param>
public override void Dispose()
{
GC.SuppressFinalize(this);
Dispose(true);
base.Dispose();
}
#endif
#if GTK3
/// <summary>
/// Disposes the current object, releasing any native resources it was using.
/// </summary>
/// <param name="disposing"></param>
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
#else
/// <summary>
/// Disposes the current object, releasing any native resources it was using.
/// </summary>
/// <param name="disposing"></param>
public virtual void Dispose(bool disposing) public virtual void Dispose(bool disposing)
{ {
#endif
if (disposing) if (disposing)
{ {
_GraphicsContext.MakeCurrent(_WindowInfo); _GraphicsContext.MakeCurrent(_WindowInfo);
@ -175,60 +208,94 @@ namespace OpenTK
#region New Events #region New Events
// Called when the first GraphicsContext is created in the case of GraphicsContext.ShareContexts == True; /// <summary>
/// Called when the first <see cref="GraphicsContext"/> is created in the case where
/// GraphicsContext.ShareContexts == true;
/// </summary>
public static event EventHandler GraphicsContextInitialized; public static event EventHandler GraphicsContextInitialized;
static void OnGraphicsContextInitialized() /// <summary>
/// Invokes the <see cref="GraphicsContextInitialized"/> event.
/// </summary>
private static void OnGraphicsContextInitialized()
{ {
if (GraphicsContextInitialized != null) if (GraphicsContextInitialized != null)
GraphicsContextInitialized(null, EventArgs.Empty); GraphicsContextInitialized(null, EventArgs.Empty);
} }
// Called when the first GraphicsContext is being destroyed in the case of GraphicsContext.ShareContexts == True; /// <summary>
/// Called when the first <see cref="GraphicsContext"/> is being destroyed in the case where
/// GraphicsContext.ShareContext == true;
/// </summary>
public static event EventHandler GraphicsContextShuttingDown; public static event EventHandler GraphicsContextShuttingDown;
static void OnGraphicsContextShuttingDown() /// <summary>
{ /// Invokes the <see cref="GraphicsContextShuttingDown"/> event.
/// </summary>
private static void OnGraphicsContextShuttingDown()
{
if (GraphicsContextShuttingDown != null) if (GraphicsContextShuttingDown != null)
GraphicsContextShuttingDown(null, EventArgs.Empty); GraphicsContextShuttingDown(null, EventArgs.Empty);
} }
// Called when this GLWidget has a valid GraphicsContext /// <summary>
/// Called when this <see cref="GLWidget"/> has finished initializing and has a valid
/// <see cref="GraphicsContext"/>.
/// </summary>
public event EventHandler Initialized; public event EventHandler Initialized;
/// <summary>
/// Invokes the <see cref="Initialized"/> event.
/// </summary>
protected virtual void OnInitialized() protected virtual void OnInitialized()
{ {
if (Initialized != null) if (Initialized != null)
Initialized(this, EventArgs.Empty); Initialized(this, EventArgs.Empty);
} }
// Called when this GLWidget needs to render a frame /// <summary>
/// Called when this <see cref="GLWidget"/> needs to render a frame.
/// </summary>
public event EventHandler RenderFrame; public event EventHandler RenderFrame;
/// <summary>
/// Invokes the <see cref="RenderFrame"/> event.
/// </summary>
protected virtual void OnRenderFrame() protected virtual void OnRenderFrame()
{ {
if (RenderFrame != null) if (RenderFrame != null)
RenderFrame(this, EventArgs.Empty); RenderFrame(this, EventArgs.Empty);
} }
// Called when this GLWidget is being Disposed /// <summary>
/// Called when this <see cref="GLWidget"/> is being disposed.
/// </summary>
public event EventHandler ShuttingDown; public event EventHandler ShuttingDown;
/// <summary>
/// Invokes the <see cref="ShuttingDown"/> event.
/// </summary>
protected virtual void OnShuttingDown() protected virtual void OnShuttingDown()
{ {
if (ShuttingDown != null) if (ShuttingDown != null)
ShuttingDown(this, EventArgs.Empty); ShuttingDown(this, EventArgs.Empty);
} }
#endregion #endregion
// Called when a widget is realized. (window handles and such are valid)
// protected override void OnRealized() { base.OnRealized(); }
// Called when the widget needs to be (fully or partially) redrawn.
#if GTK3 #if GTK3
/// <summary>
/// Called when the widget needs to be (fully or partially) redrawn.
/// </summary>
/// <param name="cr"></param>
/// <returns></returns>
protected override bool OnDrawn(Cairo.Context cr) protected override bool OnDrawn(Cairo.Context cr)
#else #else
/// <summary>
/// Called when the widget is exposed.
/// </summary>
/// <param name="cr"></param>
/// <returns></returns>
protected override bool OnExposeEvent(Gdk.EventExpose evnt) protected override bool OnExposeEvent(Gdk.EventExpose evnt)
#endif #endif
{ {
@ -254,7 +321,11 @@ namespace OpenTK
return result; return result;
} }
// Called on Resize /// <summary>
/// Called whenever the widget is resized.
/// </summary>
/// <param name="evnt"></param>
/// <returns></returns>
protected override bool OnConfigureEvent(Gdk.EventConfigure evnt) protected override bool OnConfigureEvent(Gdk.EventConfigure evnt)
{ {
bool result = base.OnConfigureEvent(evnt); bool result = base.OnConfigureEvent(evnt);
@ -265,7 +336,10 @@ namespace OpenTK
return result; return result;
} }
void Initialize() /// <summary>
/// Initializes the <see cref="GLWidget"/> with its given values and creates a <see cref="GraphicsContext"/>.
/// </summary>
private void Initialize()
{ {
_Initialized = true; _Initialized = true;
@ -292,16 +366,22 @@ namespace OpenTK
Console.WriteLine("OpenTK running on windows"); Console.WriteLine("OpenTK running on windows");
else if (Configuration.RunningOnMacOS) else if (Configuration.RunningOnMacOS)
Console.WriteLine("OpenTK running on OSX"); Console.WriteLine("OpenTK running on OSX");
else else
Console.WriteLine("OpenTK running on X11"); Console.WriteLine("OpenTK running on X11");
#if GTK3
IntPtr widgetWindowHandle = this.Window.Handle;
#else
IntPtr widgetWindowHandle = this.GdkWindow.Handle;
#endif
// IWindowInfo // IWindowInfo
if (Configuration.RunningOnWindows) if (Configuration.RunningOnWindows)
_WindowInfo = InitializeWindows(); _WindowInfo = WinWindowsInfoInitializer.Initialize(widgetWindowHandle);
else if (Configuration.RunningOnMacOS) else if (Configuration.RunningOnMacOS)
_WindowInfo = InitializeOSX(); _WindowInfo = OSXWindowInfoInitializer.Initialize(widgetWindowHandle);
else else
_WindowInfo = InitializeX(graphicsMode); _WindowInfo = XWindowInfoInitializer.Initialize(graphicsMode, this.Display.Handle, this.Screen.Number, widgetWindowHandle, this.Screen.RootWindow.Handle);
// GraphicsContext // GraphicsContext
_GraphicsContext = new GraphicsContext(graphicsMode, _WindowInfo, GlVersionMajor, GlVersionMinor, _GraphicsContextFlags); _GraphicsContext = new GraphicsContext(graphicsMode, _WindowInfo, GlVersionMajor, GlVersionMinor, _GraphicsContextFlags);
@ -326,250 +406,5 @@ namespace OpenTK
OnInitialized(); OnInitialized();
} }
#region Windows Specific initalization
IWindowInfo InitializeWindows()
{
IntPtr windowHandle = gdk_win32_drawable_get_handle(GdkWindow.Handle);
return Utilities.CreateWindowsWindowInfo(windowHandle);
}
[SuppressUnmanagedCodeSecurity, DllImport("libgdk-win32-2.0-0.dll")]
public static extern IntPtr gdk_win32_drawable_get_handle(IntPtr d);
#endregion
#region OSX Specific Initialization
IWindowInfo InitializeOSX()
{
IntPtr windowHandle = gdk_quartz_window_get_nswindow(this.GdkWindow.Handle);
IntPtr viewHandle = gdk_quartz_window_get_nsview(this.GdkWindow.Handle);
return Utilities.CreateMacOSWindowInfo(windowHandle, viewHandle);
}
[SuppressUnmanagedCodeSecurity, DllImport("libgdk-quartz-2.0.0.dylib")]
static extern IntPtr gdk_quartz_window_get_nswindow(IntPtr handle);
[SuppressUnmanagedCodeSecurity, DllImport("libgdk-quartz-2.0.0.dylib")]
static extern IntPtr gdk_quartz_window_get_nsview(IntPtr handle);
#endregion
#region X Specific Initialization
#if GTK3
const string UnixLibGdkName = "libgdk-3.so.0";
#else
const string UnixLibGdkName = "libgdk-x11-2.0.so.0";
#endif
const string UnixLibX11Name = "libX11.so.6";
const string UnixLibGLName = "libGL.so.1";
const int GLX_NONE = 0;
const int GLX_USE_GL = 1;
const int GLX_BUFFER_SIZE = 2;
const int GLX_LEVEL = 3;
const int GLX_RGBA = 4;
const int GLX_DOUBLEBUFFER = 5;
const int GLX_STEREO = 6;
const int GLX_AUX_BUFFERS = 7;
const int GLX_RED_SIZE = 8;
const int GLX_GREEN_SIZE = 9;
const int GLX_BLUE_SIZE = 10;
const int GLX_ALPHA_SIZE = 11;
const int GLX_DEPTH_SIZE = 12;
const int GLX_STENCIL_SIZE = 13;
const int GLX_ACCUM_RED_SIZE = 14;
const int GLX_ACCUM_GREEN_SIZE = 15;
const int GLX_ACCUM_BLUE_SIZE = 16;
const int GLX_ACCUM_ALPHA_SIZE = 17;
public enum XVisualClass
{
StaticGray = 0,
GrayScale = 1,
StaticColor = 2,
PseudoColor = 3,
TrueColor = 4,
DirectColor = 5,
}
[StructLayout(LayoutKind.Sequential)]
struct XVisualInfo
{
public IntPtr Visual;
public IntPtr VisualID;
public int Screen;
public int Depth;
public XVisualClass Class;
public long RedMask;
public long GreenMask;
public long blueMask;
public int ColormapSize;
public int BitsPerRgb;
public override string ToString()
{
return String.Format("id ({0}), screen ({1}), depth ({2}), class ({3})",
VisualID, Screen, Depth, Class);
}
}
[Flags]
internal enum XVisualInfoMask
{
No = 0x0,
ID = 0x1,
Screen = 0x2,
Depth = 0x4,
Class = 0x8,
Red = 0x10,
Green = 0x20,
Blue = 0x40,
ColormapSize = 0x80,
BitsPerRGB = 0x100,
All = 0x1FF,
}
IWindowInfo InitializeX(GraphicsMode mode)
{
IntPtr display = gdk_x11_display_get_xdisplay(Display.Handle);
int screen = Screen.Number;
#if GTK3
IntPtr windowHandle = gdk_x11_window_get_xid(GdkWindow.Handle);
IntPtr rootWindow = gdk_x11_window_get_xid(RootWindow.Handle);
#else
IntPtr windowHandle = gdk_x11_drawable_get_xid(GdkWindow.Handle);
IntPtr rootWindow = gdk_x11_drawable_get_xid(RootWindow.Handle);
#endif
IWindowInfo retval;
IntPtr visualInfo;
if (mode.Index.HasValue)
{
XVisualInfo info = new XVisualInfo();
info.VisualID = mode.Index.Value;
int dummy;
visualInfo = XGetVisualInfo(display, XVisualInfoMask.ID, ref info, out dummy);
}
else
visualInfo = GetVisualInfo(display);
retval = Utilities.CreateX11WindowInfo(display, screen, windowHandle, rootWindow, visualInfo);
XFree(visualInfo);
return retval;
}
static IntPtr XGetVisualInfo(IntPtr display, XVisualInfoMask vinfo_mask, ref XVisualInfo template, out int nitems)
{
return XGetVisualInfoInternal(display, (IntPtr)(int)vinfo_mask, ref template, out nitems);
}
IntPtr GetVisualInfo(IntPtr display)
{
try
{
int[] attributes = AttributeList.ToArray();
return glXChooseVisual(display, Screen.Number, attributes);
}
catch (DllNotFoundException e)
{
throw new DllNotFoundException("OpenGL dll not found!", e);
}
catch (EntryPointNotFoundException enf)
{
throw new EntryPointNotFoundException("Glx entry point not found!", enf);
}
}
List<int> AttributeList
{
get
{
List<int> attributeList = new List<int>(24);
attributeList.Add(GLX_RGBA);
if (!SingleBuffer)
attributeList.Add(GLX_DOUBLEBUFFER);
if (Stereo)
attributeList.Add(GLX_STEREO);
attributeList.Add(GLX_RED_SIZE);
attributeList.Add(ColorBPP / 4); // TODO support 16-bit
attributeList.Add(GLX_GREEN_SIZE);
attributeList.Add(ColorBPP / 4); // TODO support 16-bit
attributeList.Add(GLX_BLUE_SIZE);
attributeList.Add(ColorBPP / 4); // TODO support 16-bit
attributeList.Add(GLX_ALPHA_SIZE);
attributeList.Add(ColorBPP / 4); // TODO support 16-bit
attributeList.Add(GLX_DEPTH_SIZE);
attributeList.Add(DepthBPP);
attributeList.Add(GLX_STENCIL_SIZE);
attributeList.Add(StencilBPP);
//attributeList.Add(GLX_AUX_BUFFERS);
//attributeList.Add(Buffers);
attributeList.Add(GLX_ACCUM_RED_SIZE);
attributeList.Add(AccumulatorBPP / 4);// TODO support 16-bit
attributeList.Add(GLX_ACCUM_GREEN_SIZE);
attributeList.Add(AccumulatorBPP / 4);// TODO support 16-bit
attributeList.Add(GLX_ACCUM_BLUE_SIZE);
attributeList.Add(AccumulatorBPP / 4);// TODO support 16-bit
attributeList.Add(GLX_ACCUM_ALPHA_SIZE);
attributeList.Add(AccumulatorBPP / 4);// TODO support 16-bit
attributeList.Add(GLX_NONE);
return attributeList;
}
}
[DllImport(UnixLibX11Name, EntryPoint = "XGetVisualInfo")]
static extern IntPtr XGetVisualInfoInternal(IntPtr display, IntPtr vinfo_mask, ref XVisualInfo template, out int nitems);
[SuppressUnmanagedCodeSecurity, DllImport(UnixLibX11Name)]
static extern void XFree(IntPtr handle);
/// <summary> Returns the X resource (window or pixmap) belonging to a GdkDrawable. </summary>
/// <remarks> XID gdk_x11_drawable_get_xid(GdkDrawable *drawable); </remarks>
/// <param name="gdkDisplay"> The GdkDrawable. </param>
/// <returns> The ID of drawable's X resource. </returns>
[SuppressUnmanagedCodeSecurity, DllImport(UnixLibGdkName)]
static extern IntPtr gdk_x11_drawable_get_xid(IntPtr gdkDisplay);
/// <summary> Returns the X resource (window or pixmap) belonging to a GdkDrawable. </summary>
/// <remarks> XID gdk_x11_drawable_get_xid(GdkDrawable *drawable); </remarks>
/// <param name="gdkDisplay"> The GdkDrawable. </param>
/// <returns> The ID of drawable's X resource. </returns>
[SuppressUnmanagedCodeSecurity, DllImport(UnixLibGdkName)]
static extern IntPtr gdk_x11_window_get_xid(IntPtr gdkDisplay);
/// <summary> Returns the X display of a GdkDisplay. </summary>
/// <remarks> Display* gdk_x11_display_get_xdisplay(GdkDisplay *display); </remarks>
/// <param name="gdkDisplay"> The GdkDrawable. </param>
/// <returns> The X Display of the GdkDisplay. </returns>
[SuppressUnmanagedCodeSecurity, DllImport(UnixLibGdkName)]
static extern IntPtr gdk_x11_display_get_xdisplay(IntPtr gdkDisplay);
[SuppressUnmanagedCodeSecurity, DllImport(UnixLibGLName)]
static extern IntPtr glXChooseVisual(IntPtr display, int screen, int[] attr);
#endregion
} }
}
}

View file

@ -0,0 +1,38 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
using OpenTK.Platform;
namespace OpenTK.OSX
{
/// <summary>
/// Handler class for initializing <see cref="IWindowInfo"/> objects under the OSX platform for both GTK2 and
/// GTK3.
/// </summary>
public static class OSXWindowInfoInitializer
{
#if GTK3
const string OSXLibGdkName = "libgdk-3.dylib";
#else
const string OSXLibGdkName = "libgdk-quartz-2.0.0.dylib";
#endif
/// <summary>
/// Initializes an <see cref="IWindowInfo"/> under the OSX platform.
/// </summary>
/// <param name="gdkWindowHandle"></param>
public static IWindowInfo Initialize(IntPtr gdkWindowHandle)
{
IntPtr windowHandle = gdk_quartz_window_get_nswindow(gdkWindowHandle);
IntPtr viewHandle = gdk_quartz_window_get_nsview(gdkWindowHandle);
return Utilities.CreateMacOSWindowInfo(windowHandle, viewHandle);
}
[SuppressUnmanagedCodeSecurity, DllImport(OSXLibGdkName)]
private static extern IntPtr gdk_quartz_window_get_nswindow(IntPtr handle);
[SuppressUnmanagedCodeSecurity, DllImport(OSXLibGdkName)]
private static extern IntPtr gdk_quartz_window_get_nsview(IntPtr handle);
}
}

View file

@ -1,5 +1,5 @@
<?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"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
<PropertyGroup> <PropertyGroup>
<ProjectType>Local</ProjectType> <ProjectType>Local</ProjectType>
<ProductVersion>8.0.30703</ProductVersion> <ProductVersion>8.0.30703</ProductVersion>
@ -41,13 +41,14 @@
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
<LangVersion>6</LangVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress> <BaseAddress>285212672</BaseAddress>
<ConfigurationOverrideFile> <ConfigurationOverrideFile>
</ConfigurationOverrideFile> </ConfigurationOverrideFile>
<DefineConstants>DEBUG;TRACE;</DefineConstants> <DefineConstants>DEBUG;TRACE;GTK3;</DefineConstants>
<DocumentationFile>bin\Debug\OpenTK.GLWidget.xml</DocumentationFile> <DocumentationFile>bin\Debug\OpenTK.GLWidget.xml</DocumentationFile>
<DebugSymbols>True</DebugSymbols> <DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
@ -65,7 +66,7 @@
<BaseAddress>285212672</BaseAddress> <BaseAddress>285212672</BaseAddress>
<ConfigurationOverrideFile> <ConfigurationOverrideFile>
</ConfigurationOverrideFile> </ConfigurationOverrideFile>
<DefineConstants>TRACE;</DefineConstants> <DefineConstants>TRACE;GTK3;</DefineConstants>
<DocumentationFile>bin\Release\OpenTK.GLWidget.xml</DocumentationFile> <DocumentationFile>bin\Release\OpenTK.GLWidget.xml</DocumentationFile>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize> <Optimize>True</Optimize>
@ -87,13 +88,47 @@
<Reference Include="System"> <Reference Include="System">
<Name>System</Name> <Name>System</Name>
</Reference> </Reference>
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
</ItemGroup> </ItemGroup>
<Choose>
<When Condition="$(DefineConstants.Contains('GTK3'))">
<ItemGroup>
<Reference Include="atk-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<HintPath>..\..\packages\gtk-sharp3\lib\net40\atk-sharp.dll</HintPath>
</Reference>
<Reference Include="cairo-sharp, Version=1.12.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756">
<HintPath>..\..\packages\gtk-sharp3\lib\net40\cairo-sharp.dll</HintPath>
</Reference>
<Reference Include="gdk-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<HintPath>..\..\packages\gtk-sharp3\lib\net40\gdk-sharp.dll</HintPath>
</Reference>
<Reference Include="gio-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<HintPath>..\..\packages\gtk-sharp3\lib\net40\gio-sharp.dll</HintPath>
</Reference>
<Reference Include="glib-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<HintPath>..\..\packages\gtk-sharp3\lib\net40\glib-sharp.dll</HintPath>
</Reference>
<Reference Include="gtk-dotnet, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<HintPath>..\..\packages\gtk-sharp3\lib\net40\gtk-dotnet.dll</HintPath>
</Reference>
<Reference Include="gtk-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<HintPath>..\..\packages\gtk-sharp3\lib\net40\gtk-sharp.dll</HintPath>
</Reference>
<Reference Include="pango-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<HintPath>..\..\packages\gtk-sharp3\lib\net40\pango-sharp.dll</HintPath>
</Reference>
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\OpenTK\OpenTK.csproj"> <ProjectReference Include="..\OpenTK\OpenTK.csproj">
<Name>OpenTK</Name> <Name>OpenTK</Name>
@ -102,44 +137,17 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="OSX\OSXWindowInfoInitializer.cs" />
<Compile Include="Properties\AssemblyInfo.cs"> <Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="GLWidget.cs" /> <Compile Include="GLWidget.cs" />
<Compile Include="Win\WinWindowsInfoInitializer.cs" />
<Compile Include="X11\XWindowInfoInitializer.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="paket.references" /> <None Include="paket.references" />
<None Include="paket.template" /> <None Include="paket.template" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7')">
<PropertyGroup>
<__paket__GtkSharp_targets>net45\GtkSharp</__paket__GtkSharp_targets>
</PropertyGroup>
</When>
</Choose>
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7')">
<ItemGroup>
<Reference Include="cairo-sharp">
<HintPath>..\..\packages\GtkSharp\lib\net45\cairo-sharp.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
<Reference Include="gio-sharp">
<HintPath>..\..\packages\GtkSharp\lib\net45\gio-sharp.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Import Project="..\..\packages\GtkSharp\build\$(__paket__GtkSharp_targets).targets" Condition="Exists('..\..\packages\GtkSharp\build\$(__paket__GtkSharp_targets).targets')" Label="Paket" />
</Project> </Project>

View file

@ -0,0 +1,43 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
using OpenTK.Platform;
namespace OpenTK.Win
{
/// <summary>
/// Handler class for initializing <see cref="IWindowInfo"/> objects under the Windows platform for both GTK2 and
/// GTK3.
/// </summary>
public static class WinWindowsInfoInitializer
{
#if GTK3
private const string WinLibGDKName = "libgdk-3-0.dll";
#else
private const string WinLibGDKName = "libgdk-win32-2.0-0.dll";
#endif
/// <summary>
/// Initializes an <see cref="IWindowInfo"/> under the Windows platform.
/// </summary>
/// <param name="gdkWindowHandle"></param>
public static IWindowInfo Initialize(IntPtr gdkWindowHandle)
{
#if GTK3
IntPtr windowHandle = gdk_win32_window_get_handle(gdkWindowHandle);
#else
IntPtr windowHandle = gdk_win32_drawable_get_handle(gdkWindowHandle);
#endif
return Utilities.CreateWindowsWindowInfo(windowHandle);
}
#if GTK3
[SuppressUnmanagedCodeSecurity, DllImport(WinLibGDKName, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gdk_win32_window_get_handle(IntPtr w);
#else
[SuppressUnmanagedCodeSecurity, DllImport(WinLibGDKName, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr gdk_win32_drawable_get_handle(IntPtr d);
#endif
}
}

View file

@ -0,0 +1,175 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Security;
using OpenTK.Graphics;
using OpenTK.Platform;
using OpenTK.Platform.X11;
namespace OpenTK.X11
{
/// <summary>
/// Handler class for initializing <see cref="IWindowInfo"/> objects under the X11 platform for both GTK2 and GTK3.
/// </summary>
public static class XWindowInfoInitializer
{
#if GTK3
const string UnixLibGdkName = "libgdk-3.so.0";
#else
const string UnixLibGdkName = "libgdk-x11-2.0.so.0";
#endif
private const string UnixLibX11Name = "libX11.so.6";
private const string UnixLibGLName = "libGL.so.1";
/// <summary>
/// Initializes an <see cref="IWindowInfo"/> under the X11 platform.
/// </summary>
/// <param name="mode"></param>
/// <param name="displayHandle"></param>
/// <param name="screenNumber"></param>
/// <param name="gdkWindowHandle"></param>
/// <param name="gdkRootWindowHandle"></param>
/// <returns></returns>
public static IWindowInfo Initialize(GraphicsMode mode, IntPtr displayHandle, int screenNumber, IntPtr gdkWindowHandle, IntPtr gdkRootWindowHandle)
{
IntPtr display = gdk_x11_display_get_xdisplay(displayHandle);
#if GTK3
IntPtr windowXid = gdk_x11_window_get_xid(gdkWindowHandle);
IntPtr rootWindowXid = gdk_x11_window_get_xid(gdkRootWindowHandle);
#else
IntPtr windowXid = gdk_x11_drawable_get_xid(gdkWindowHandle);
IntPtr rootWindowXid = gdk_x11_drawable_get_xid(gdkRootWindowHandle);
#endif
IntPtr visualInfo;
if (mode.Index.HasValue)
{
XVisualInfo info = new XVisualInfo
{
VisualID = mode.Index.Value
};
int dummy;
visualInfo = XGetVisualInfo(display, XVisualInfoMask.ID, ref info, out dummy);
}
else
{
visualInfo = GetVisualInfo(mode, display, screenNumber);
}
IWindowInfo retval = Utilities.CreateX11WindowInfo(display, screenNumber, windowXid, rootWindowXid, visualInfo);
XFree(visualInfo);
return retval;
}
private static IntPtr XGetVisualInfo(IntPtr display, XVisualInfoMask infoMask, ref XVisualInfo template, out int nitems)
{
return XGetVisualInfoInternal(display, (IntPtr)(int)infoMask, ref template, out nitems);
}
private static IntPtr GetVisualInfo(GraphicsMode mode, IntPtr display, int screenNumber)
{
try
{
int[] attributes = CreateAttributeList(mode).ToArray();
return glXChooseVisual(display, screenNumber, attributes);
}
catch (DllNotFoundException e)
{
throw new DllNotFoundException("OpenGL dll not found!", e);
}
catch (EntryPointNotFoundException enf)
{
throw new EntryPointNotFoundException("Glx entry point not found!", enf);
}
}
private static List<int> CreateAttributeList(GraphicsMode mode)
{
List<int> attributeList = new List<int>(24);
attributeList.Add((int)GLXAttribute.RGBA);
if (mode.Buffers > 1)
{
attributeList.Add((int)GLXAttribute.DOUBLEBUFFER);
}
if (mode.Stereo)
{
attributeList.Add((int)GLXAttribute.STEREO);
}
attributeList.Add((int)GLXAttribute.RED_SIZE);
attributeList.Add(mode.ColorFormat.Red / 4); // TODO support 16-bit
attributeList.Add((int)GLXAttribute.GREEN_SIZE);
attributeList.Add(mode.ColorFormat.Green / 4); // TODO support 16-bit
attributeList.Add((int)GLXAttribute.BLUE_SIZE);
attributeList.Add(mode.ColorFormat.Blue / 4); // TODO support 16-bit
attributeList.Add((int)GLXAttribute.ALPHA_SIZE);
attributeList.Add(mode.ColorFormat.Alpha / 4); // TODO support 16-bit
attributeList.Add((int)GLXAttribute.DEPTH_SIZE);
attributeList.Add(mode.Depth);
attributeList.Add((int)GLXAttribute.STENCIL_SIZE);
attributeList.Add(mode.Stencil);
//attributeList.Add(GLX_AUX_BUFFERS);
//attributeList.Add(Buffers);
attributeList.Add((int)GLXAttribute.ACCUM_RED_SIZE);
attributeList.Add(mode.AccumulatorFormat.Red / 4);// TODO support 16-bit
attributeList.Add((int)GLXAttribute.ACCUM_GREEN_SIZE);
attributeList.Add(mode.AccumulatorFormat.Green / 4);// TODO support 16-bit
attributeList.Add((int)GLXAttribute.ACCUM_BLUE_SIZE);
attributeList.Add(mode.AccumulatorFormat.Blue / 4);// TODO support 16-bit
attributeList.Add((int)GLXAttribute.ACCUM_ALPHA_SIZE);
attributeList.Add(mode.AccumulatorFormat.Alpha / 4);// TODO support 16-bit
attributeList.Add((int)GLXAttribute.NONE);
return attributeList;
}
[DllImport(UnixLibX11Name, EntryPoint = "XGetVisualInfo")]
private static extern IntPtr XGetVisualInfoInternal(IntPtr display, IntPtr infoMask, ref XVisualInfo template, out int nitems);
[SuppressUnmanagedCodeSecurity, DllImport(UnixLibX11Name)]
private static extern void XFree(IntPtr handle);
#if GTK3
/// <summary> Returns the X resource (window or pixmap) belonging to a GdkWindow. </summary>
/// <remarks> XID gdk_x11_window_get_xid(GdkWindow *drawable); </remarks>
/// <param name="gdkDisplay"> The GdkDrawable. </param>
/// <returns> The ID of window's X resource. </returns>
[SuppressUnmanagedCodeSecurity, DllImport(UnixLibGdkName)]
private static extern IntPtr gdk_x11_window_get_xid(IntPtr gdkDisplay);
#else
/// <summary> Returns the X resource (window or pixmap) belonging to a GdkDrawable. </summary>
/// <remarks> XID gdk_x11_drawable_get_xid(GdkDrawable *drawable); </remarks>
/// <param name="gdkDisplay"> The GdkDrawable. </param>
/// <returns> The ID of drawable's X resource. </returns>
[SuppressUnmanagedCodeSecurity, DllImport(UnixLibGdkName)]
static extern IntPtr gdk_x11_drawable_get_xid(IntPtr gdkDisplay);
#endif
/// <summary> Returns the X display of a GdkDisplay. </summary>
/// <remarks> Display* gdk_x11_display_get_xdisplay(GdkDisplay *display); </remarks>
/// <param name="gdkDisplay"> The GdkDrawable. </param>
/// <returns> The X Display of the GdkDisplay. </returns>
[SuppressUnmanagedCodeSecurity, DllImport(UnixLibGdkName)]
private static extern IntPtr gdk_x11_display_get_xdisplay(IntPtr gdkDisplay);
[SuppressUnmanagedCodeSecurity, DllImport(UnixLibGLName)]
private static extern IntPtr glXChooseVisual(IntPtr display, int screen, int[] attr);
}
}

View file

@ -1 +1 @@
GtkSharp gtk-sharp3

View file

@ -70,7 +70,7 @@ namespace OpenTK.Platform.X11
static int DefaultScreen { get { return defaultScreen; } } static int DefaultScreen { get { return defaultScreen; } }
//internal static Window RootWindow { get { return rootWindow; } } //internal static Window RootWindow { get { return rootWindow; } }
internal static int ScreenCount { get { return screenCount; } } internal static int ScreenCount { get { return screenCount; } }
internal static object Lock = new object(); internal static object Lock = new object();
#endregion #endregion
@ -79,9 +79,9 @@ namespace OpenTK.Platform.X11
{ {
int has_threaded_x = Functions.XInitThreads(); int has_threaded_x = Functions.XInitThreads();
Debug.Print("Initializing threaded X11: {0}.", has_threaded_x.ToString()); Debug.Print("Initializing threaded X11: {0}.", has_threaded_x.ToString());
defaultDisplay = Functions.XOpenDisplay(IntPtr.Zero); defaultDisplay = Functions.XOpenDisplay(IntPtr.Zero);
if (defaultDisplay == IntPtr.Zero) if (defaultDisplay == IntPtr.Zero)
throw new PlatformException("Could not establish connection to the X-Server."); throw new PlatformException("Could not establish connection to the X-Server.");
@ -202,7 +202,7 @@ namespace OpenTK.Platform.X11
/// If a window is not interested in a device event, /// If a window is not interested in a device event,
/// it usually propagates to the closest ancestor that is interested, /// it usually propagates to the closest ancestor that is interested,
/// unless the do_not_propagate mask prohibits it. /// unless the do_not_propagate mask prohibits it.
/// Setting the event-mask attribute of a window overrides any previous call for the same window but not for other clients. Multiple clients can select for the same events on the same window with the following restrictions: /// Setting the event-mask attribute of a window overrides any previous call for the same window but not for other clients. Multiple clients can select for the same events on the same window with the following restrictions:
/// <para>Multiple clients can select events on the same window because their event masks are disjoint. When the X server generates an event, it reports it to all interested clients. </para> /// <para>Multiple clients can select events on the same window because their event masks are disjoint. When the X server generates an event, it reports it to all interested clients. </para>
/// <para>Only one client at a time can select CirculateRequest, ConfigureRequest, or MapRequest events, which are associated with the event mask SubstructureRedirectMask. </para> /// <para>Only one client at a time can select CirculateRequest, ConfigureRequest, or MapRequest events, which are associated with the event mask SubstructureRedirectMask. </para>
/// <para>Only one client at a time can select a ResizeRequest event, which is associated with the event mask ResizeRedirectMask. </para> /// <para>Only one client at a time can select a ResizeRequest event, which is associated with the event mask ResizeRedirectMask. </para>
@ -343,7 +343,7 @@ namespace OpenTK.Platform.X11
public short htotal; public short htotal;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public short hskew; public short hskew;
@ -368,7 +368,7 @@ namespace OpenTK.Platform.X11
public short vtotal; public short vtotal;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public short vskew; public short vskew;
@ -580,26 +580,26 @@ XF86VidModeGetGammaRampSize(
public XcursorUInt delay; public XcursorUInt delay;
public XcursorPixel* pixels; public XcursorPixel* pixels;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
unsafe struct XcursorImages unsafe struct XcursorImages
{ {
public int nimage; public int nimage;
public XcursorImage **images; public XcursorImage **images;
public char *name; public char *name;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
unsafe struct XcursorCursors unsafe struct XcursorCursors
{ {
public Display dpy; public Display dpy;
public int refcount; public int refcount;
public int ncursor; public int ncursor;
public Cursor *cursors; public Cursor *cursors;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
unsafe struct XcursorAnimate unsafe struct XcursorAnimate
{ {
public XcursorCursors *cursors; public XcursorCursors *cursors;
public int sequence; public int sequence;
@ -607,10 +607,10 @@ XF86VidModeGetGammaRampSize(
#endregion #endregion
#region internal class XVisualInfo #region public class XVisualInfo
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
struct XVisualInfo public struct XVisualInfo
{ {
public IntPtr Visual; public IntPtr Visual;
public VisualID VisualID; public VisualID VisualID;
@ -755,7 +755,7 @@ XF86VidModeGetGammaRampSize(
UIntPtr black_pixel; /* White and Black pixel values */ // unsigned long UIntPtr black_pixel; /* White and Black pixel values */ // unsigned long
int max_maps, min_maps; /* max and min color maps */ int max_maps, min_maps; /* max and min color maps */
int backing_store; /* Never, WhenMapped, Always */ int backing_store; /* Never, WhenMapped, Always */
Bool save_unders; Bool save_unders;
long root_input_mask; /* initial root input mask */ long root_input_mask; /* initial root input mask */
} }
@ -773,9 +773,9 @@ XF86VidModeGetGammaRampSize(
}; };
#endregion #endregion
#region Motif #region Motif
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
internal struct MotifWmHints internal struct MotifWmHints
{ {
@ -790,7 +790,7 @@ XF86VidModeGetGammaRampSize(
return string.Format("MotifWmHints <flags={0}, functions={1}, decorations={2}, input_mode={3}, status={4}", (MotifFlags) flags.ToInt32 (), (MotifFunctions) functions.ToInt32 (), (MotifDecorations) decorations.ToInt32 (), (MotifInputMode) input_mode.ToInt32 (), status.ToInt32 ()); return string.Format("MotifWmHints <flags={0}, functions={1}, decorations={2}, input_mode={3}, status={4}", (MotifFlags) flags.ToInt32 (), (MotifFunctions) functions.ToInt32 (), (MotifDecorations) decorations.ToInt32 (), (MotifInputMode) input_mode.ToInt32 (), status.ToInt32 ());
} }
} }
[Flags] [Flags]
internal enum MotifFlags internal enum MotifFlags
{ {
@ -821,7 +821,7 @@ XF86VidModeGetGammaRampSize(
Menu = 0x10, Menu = 0x10,
Minimize = 0x20, Minimize = 0x20,
Maximize = 0x40, Maximize = 0x40,
} }
[Flags] [Flags]
@ -832,7 +832,7 @@ XF86VidModeGetGammaRampSize(
SystemModal = 2, SystemModal = 2,
FullApplicationModal = 3 FullApplicationModal = 3
} }
#endregion #endregion
#endregion #endregion
@ -985,7 +985,7 @@ XF86VidModeGetGammaRampSize(
SingleCandidate = 0xff3c, SingleCandidate = 0xff3c,
MultipleCandidate = 0xff3d, MultipleCandidate = 0xff3d,
PreviousCandidate = 0xff3e, PreviousCandidate = 0xff3e,
/* Japanese keyboard support */ /* Japanese keyboard support */
Kanji = 0xff21, /* Kanji, Kanji convert */ Kanji = 0xff21, /* Kanji, Kanji convert */
@ -1367,7 +1367,7 @@ XF86VidModeGetGammaRampSize(
#pragma warning restore 1591 #pragma warning restore 1591
[Flags] [Flags]
internal enum XVisualInfoMask public enum XVisualInfoMask
{ {
No = 0x0, No = 0x0,
ID = 0x1, ID = 0x1,
@ -1437,7 +1437,7 @@ XF86VidModeGetGammaRampSize(
/// <param name="attributes">Specifies the structure from which the values (as specified by the value mask) are to be taken. The value mask should have the appropriate bits set to indicate which attributes have been set in the structure.</param> /// <param name="attributes">Specifies the structure from which the values (as specified by the value mask) are to be taken. The value mask should have the appropriate bits set to indicate which attributes have been set in the structure.</param>
/// <returns>The window ID of the created window.</returns> /// <returns>The window ID of the created window.</returns>
/// <remarks> /// <remarks>
/// The coordinate system has the X axis horizontal and the Y axis vertical with the origin [0, 0] at the upper-left corner. Coordinates are integral, in terms of pixels, and coincide with pixel centers. Each window and pixmap has its own coordinate system. For a window, the origin is inside the border at the inside, upper-left corner. /// The coordinate system has the X axis horizontal and the Y axis vertical with the origin [0, 0] at the upper-left corner. Coordinates are integral, in terms of pixels, and coincide with pixel centers. Each window and pixmap has its own coordinate system. For a window, the origin is inside the border at the inside, upper-left corner.
/// <para>The border_width for an InputOnly window must be zero, or a BadMatch error results. For class InputOutput, the visual type and depth must be a combination supported for the screen, or a BadMatch error results. The depth need not be the same as the parent, but the parent must not be a window of class InputOnly, or a BadMatch error results. For an InputOnly window, the depth must be zero, and the visual must be one supported by the screen. If either condition is not met, a BadMatch error results. The parent window, however, may have any depth and class. If you specify any invalid window attribute for a window, a BadMatch error results. </para> /// <para>The border_width for an InputOnly window must be zero, or a BadMatch error results. For class InputOutput, the visual type and depth must be a combination supported for the screen, or a BadMatch error results. The depth need not be the same as the parent, but the parent must not be a window of class InputOnly, or a BadMatch error results. For an InputOnly window, the depth must be zero, and the visual must be one supported by the screen. If either condition is not met, a BadMatch error results. The parent window, however, may have any depth and class. If you specify any invalid window attribute for a window, a BadMatch error results. </para>
/// <para>The created window is not yet displayed (mapped) on the user's display. To display the window, call XMapWindow(). The new window initially uses the same cursor as its parent. A new cursor can be defined for the new window by calling XDefineCursor(). The window will not be visible on the screen unless it and all of its ancestors are mapped and it is not obscured by any of its ancestors. </para> /// <para>The created window is not yet displayed (mapped) on the user's display. To display the window, call XMapWindow(). The new window initially uses the same cursor as its parent. A new cursor can be defined for the new window by calling XDefineCursor(). The window will not be visible on the screen unless it and all of its ancestors are mapped and it is not obscured by any of its ancestors. </para>
/// <para>XCreateWindow can generate BadAlloc BadColor, BadCursor, BadMatch, BadPixmap, BadValue, and BadWindow errors. </para> /// <para>XCreateWindow can generate BadAlloc BadColor, BadCursor, BadMatch, BadPixmap, BadValue, and BadWindow errors. </para>
@ -1488,7 +1488,7 @@ XF86VidModeGetGammaRampSize(
internal static unsafe extern void XcursorImageDestroy(XcursorImage* image); internal static unsafe extern void XcursorImageDestroy(XcursorImage* image);
[DllImport(XcursorLibrary)] [DllImport(XcursorLibrary)]
internal static unsafe extern Cursor XcursorImageLoadCursor(Display dpy, XcursorImage* image); internal static unsafe extern Cursor XcursorImageLoadCursor(Display dpy, XcursorImage* image);
#endregion #endregion
@ -1538,7 +1538,7 @@ XF86VidModeGetGammaRampSize(
/// <param name="event">Specifies the event.</param> /// <param name="event">Specifies the event.</param>
[DllImport(X11Library, EntryPoint = "XPutBackEvent")] [DllImport(X11Library, EntryPoint = "XPutBackEvent")]
public static extern void XPutBackEvent(IntPtr display, ref XEvent @event); public static extern void XPutBackEvent(IntPtr display, ref XEvent @event);
#endregion #endregion
#region Xrandr #region Xrandr

View file

@ -17,7 +17,7 @@ namespace OpenTK.Platform.X11
{ {
#region Enums #region Enums
enum GLXAttribute : int public enum GLXAttribute : int
{ {
TRANSPARENT_BLUE_VALUE_EXT = 0x27, TRANSPARENT_BLUE_VALUE_EXT = 0x27,
GRAY_SCALE = 0x8006, GRAY_SCALE = 0x8006,
@ -364,7 +364,7 @@ namespace OpenTK.Platform.X11
[DllImport(Library, EntryPoint = "glXCreateContext")] [DllImport(Library, EntryPoint = "glXCreateContext")]
public static extern IntPtr CreateContext(IntPtr dpy, ref XVisualInfo vis, IntPtr shareList, bool direct); public static extern IntPtr CreateContext(IntPtr dpy, ref XVisualInfo vis, IntPtr shareList, bool direct);
[DllImport(Library, EntryPoint = "glXDestroyContext")] [DllImport(Library, EntryPoint = "glXDestroyContext")]
public static extern void DestroyContext(IntPtr dpy, IntPtr context); public static extern void DestroyContext(IntPtr dpy, IntPtr context);

View file

@ -147,24 +147,6 @@
</When> </When>
</Choose> </Choose>
<Choose> <Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v2.0' Or $(TargetFrameworkVersion) == 'v3.0' Or $(TargetFrameworkVersion) == 'v3.5')">
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\net20\FSharp.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.0'">
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\net40\FSharp.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7')"> <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7')">
<ItemGroup> <ItemGroup>
<Reference Include="FSharp.Core"> <Reference Include="FSharp.Core">
@ -183,24 +165,6 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
</When> </When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v1.2' Or $(TargetFrameworkVersion) == 'v1.3' Or $(TargetFrameworkVersion) == 'v1.4' Or $(TargetFrameworkVersion) == 'v1.5')">
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\portable-net45+netcore45\FSharp.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETStandard' And $(TargetFrameworkVersion) == 'v1.0'">
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\portable-net45+netcore45+wp8\FSharp.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose> </Choose>
<Choose> <Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7')"> <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7')">
@ -1437,7 +1401,7 @@
</When> </When>
</Choose> </Choose>
<Choose> <Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7')"> <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7')">
<ItemGroup> <ItemGroup>
<Reference Include="System.Threading.Thread"> <Reference Include="System.Threading.Thread">
<HintPath>..\..\packages\System.Threading.Thread\lib\net46\System.Threading.Thread.dll</HintPath> <HintPath>..\..\packages\System.Threading.Thread\lib\net46\System.Threading.Thread.dll</HintPath>
@ -1457,7 +1421,7 @@
</When> </When>
</Choose> </Choose>
<Choose> <Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7')"> <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7')">
<ItemGroup> <ItemGroup>
<Reference Include="System.Threading.ThreadPool"> <Reference Include="System.Threading.ThreadPool">
<HintPath>..\..\packages\System.Threading.ThreadPool\lib\net46\System.Threading.ThreadPool.dll</HintPath> <HintPath>..\..\packages\System.Threading.ThreadPool\lib\net46\System.Threading.ThreadPool.dll</HintPath>