mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 19:45:29 +00:00
[Platform] Added internal CreateGetAddress() function
CreateGetAddress() constructs a GraphicsContext.GetAddressDelegate that is suitable for the current platform. This can be used when combining OpenTK with an OpenGL context created through a third-party toolkit.
This commit is contained in:
parent
cf76aa6085
commit
8bcbb06f8e
|
@ -170,6 +170,32 @@ namespace OpenTK.Platform
|
|||
|
||||
#endregion
|
||||
|
||||
#region CreateGetAddress
|
||||
|
||||
internal static GraphicsContext.GetAddressDelegate CreateGetAddress()
|
||||
{
|
||||
GraphicsContext.GetAddressDelegate loader = null;
|
||||
if (Configuration.RunningOnWindows)
|
||||
{
|
||||
loader = Platform.Windows.Wgl.GetProcAddress;
|
||||
}
|
||||
else if (Configuration.RunningOnX11)
|
||||
{
|
||||
loader = Platform.X11.Glx.GetProcAddress;
|
||||
}
|
||||
else if (Configuration.RunningOnMacOS)
|
||||
{
|
||||
loader = Platform.MacOS.NS.GetAddress;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new PlatformNotSupportedException();
|
||||
}
|
||||
return loader;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- Creating a Graphics Context ---
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in a new issue