OpenGlUtil.cs 480 B

12345678910111213141516171819202122
  1. // $Id$
  2. using System;
  3. using System.Runtime.InteropServices;
  4. using System.Security;
  5. namespace OpenGlUtil
  6. {
  7. public static class glu
  8. {
  9. private const string GLU_DLL = "GLU.dll";
  10. [DllImport(GLU_DLL, EntryPoint = "gluErrorString"), SuppressUnmanagedCodeSecurityAttribute]
  11. private static extern IntPtr _ErrorString(uint error);
  12. public static string ErrorString(uint error)
  13. {
  14. IntPtr errorstr = _ErrorString(error);
  15. return Marshal.PtrToStringAuto(errorstr);
  16. }
  17. }
  18. }