Opentk/Source/OpenTK/Platform/MacOS/Cocoa/Class.cs

22 lines
486 B
C#
Raw Normal View History

2014-04-18 20:30:50 +00:00
using System.Runtime.InteropServices;
using System;
namespace OpenTK.Platform.MacOS
{
static class Class
{
[DllImport (Cocoa.LibObjC)]
extern static IntPtr objc_getClass(string name);
public static IntPtr Get(string name)
{
var id = objc_getClass(name);
if (id == IntPtr.Zero)
{
throw new ArgumentException("Unknown class: " + name);
}
return id;
}
}
}