mirror of
https://github.com/Ryujinx/GLWidget.git
synced 2024-12-22 13:55:31 +00:00
1.0.3.2
This commit is contained in:
parent
0d95997345
commit
b999bbcfd5
|
@ -51,10 +51,12 @@ namespace OpenTK
|
|||
[ToolboxItem(true)]
|
||||
public class GLWidget : DrawingArea
|
||||
{
|
||||
/// <summary>
|
||||
/// Get or set the OpenGL minimum color buffer bits.
|
||||
/// </summary>
|
||||
[Property("color-bits")]
|
||||
private static bool xThreadInit;
|
||||
|
||||
/// <summary>
|
||||
/// Get or set the OpenGL minimum color buffer bits.
|
||||
/// </summary>
|
||||
[Property("color-bits")]
|
||||
public uint ColorBits
|
||||
{
|
||||
get { return (_ColorBits); }
|
||||
|
@ -194,7 +196,7 @@ namespace OpenTK
|
|||
/// <summary>Constructs a new GLWidget</summary>
|
||||
public GLWidget(Version apiVersion, bool forwardCompatible)
|
||||
{
|
||||
GLVersionMajor = apiVersion.Major;
|
||||
GLVersionMajor = apiVersion.Major;
|
||||
GLVersionMinor = apiVersion.Minor;
|
||||
ForwardCompatible = forwardCompatible;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Description>GLWigdet for GTKSharp, using Opentk.</Description>
|
||||
<Version>1.0.3-pre1</Version>
|
||||
<Version>1.0.3.2</Version>
|
||||
<RepositoryUrl>https://github.com/Ryujinx/GLWidget</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace OpenTK
|
|||
}
|
||||
|
||||
public static bool Loaded;
|
||||
|
||||
private static bool _threadsInitialized;
|
||||
private const string GlxLibrary = "libGL.so.1";
|
||||
private const string WglLibrary = "opengl32.dll";
|
||||
private const string OSXLibrary = "libdl.dylib";
|
||||
|
@ -210,6 +210,21 @@ namespace OpenTK
|
|||
return symbol;
|
||||
}
|
||||
|
||||
public static void InitXThreads()
|
||||
{
|
||||
if (_threadsInitialized)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (CurrentPlatform == OSPlatform.Linux)
|
||||
{
|
||||
_threadsInitialized = true;
|
||||
|
||||
UnsafeNativeMethods.XInitThreads();
|
||||
}
|
||||
}
|
||||
|
||||
internal static class UnsafeNativeMethods
|
||||
{
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
|
@ -242,6 +257,9 @@ namespace OpenTK
|
|||
[DllImport(OSXLibrary, EntryPoint = "NSAddressOfSymbol")]
|
||||
public static extern IntPtr NSAddressOfSymbol(IntPtr symbol);
|
||||
|
||||
[DllImport("libX11.so.6")]
|
||||
public extern static int XInitThreads();
|
||||
|
||||
[DllImport(OSXLibrary)]
|
||||
public extern static int CGLSetCurrentContext(IntPtr ctx);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using Gtk;
|
||||
using OpenTK;
|
||||
|
||||
|
@ -9,6 +10,7 @@ namespace GLWidgetTestGTK3
|
|||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
GTKBindingHelper.InitXThreads();
|
||||
// GTK
|
||||
Application.Init();
|
||||
MainWindow win = MainWindow.Create();
|
||||
|
|
Loading…
Reference in a new issue