mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-07 17:30:38 +00:00
Merge pull request #524 from Nihlus/glwidget-gtk3
GTK3 updates for GLWidget
This commit is contained in:
commit
8c66c332ab
|
@ -89,7 +89,6 @@ let activeProjects =
|
||||||
|
|
||||||
!! "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
|
||||||
|
|
|
@ -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
|
||||||
|
|
126
paket.lock
126
paket.lock
|
@ -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
|
||||||
|
|
|
@ -1,95 +1,91 @@
|
||||||
#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
|
||||||
|
@ -106,7 +102,9 @@ 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)
|
||||||
{
|
{
|
||||||
|
@ -118,7 +116,15 @@ namespace OpenTK
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <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,45 +208,73 @@ 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)
|
||||||
|
@ -222,13 +283,19 @@ namespace OpenTK
|
||||||
|
|
||||||
#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;
|
||||||
|
|
||||||
|
@ -295,13 +369,19 @@ namespace OpenTK
|
||||||
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
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
38
src/OpenTK.GLWidget/OSX/OSXWindowInfoInitializer.cs
Normal file
38
src/OpenTK.GLWidget/OSX/OSXWindowInfoInitializer.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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,6 +88,38 @@
|
||||||
<Reference Include="System">
|
<Reference Include="System">
|
||||||
<Name>System</Name>
|
<Name>System</Name>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
</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="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="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="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
|
||||||
|
@ -94,6 +127,8 @@
|
||||||
<Reference Include="gtk-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" />
|
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
|
||||||
</ItemGroup>
|
</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>
|
43
src/OpenTK.GLWidget/Win/WinWindowsInfoInitializer.cs
Normal file
43
src/OpenTK.GLWidget/Win/WinWindowsInfoInitializer.cs
Normal 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
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
175
src/OpenTK.GLWidget/X11/XWindowInfoInitializer.cs
Normal file
175
src/OpenTK.GLWidget/X11/XWindowInfoInitializer.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1 +1 @@
|
||||||
GtkSharp
|
gtk-sharp3
|
||||||
|
|
|
@ -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;
|
||||||
|
@ -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,
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue