/// <summary> /// Static constructor. /// </summary> static GetProcAddress() { PlatformID pId = Environment.OSVersion.Platform; // Determine GetOpenGLProcAddress implementation if ((pId == PlatformID.Win32NT) || (pId == PlatformID.Win32S) || (pId == PlatformID.Win32Windows) || (pId == PlatformID.WinCE)) { sGetProcAddress = new GetProcAddressWindows(); } else if ((pId == PlatformID.Unix) || (pId == (PlatformID)4)) { string pIdString = DetectUnixKernel(); // Distinguish between Unix and Mac OS X kernels. switch (pIdString) { case "Unix": case "Linux": sGetProcAddress = new GetProcAddressX11(); break; case "Darwin": sGetProcAddress = new GetProcAddressOSX(); break; default: throw new PlatformNotSupportedException(pIdString + ": unknown Unix platform - cannot load extensions"); } } else { throw new PlatformNotSupportedException("extension loading is only supported under Mac OS X, Unix/X11 and Windows"); } }
/// <summary> /// Static constructor. /// </summary> static GetProcAddress() { PlatformID pId = Environment.OSVersion.Platform; // Determine GetOpenGLProcAddress implementation if ((pId == PlatformID.Win32NT) || (pId == PlatformID.Win32S) || (pId == PlatformID.Win32Windows) || (pId == PlatformID.WinCE)) { _GetProcAddress = new GetProcAddressWindows(); } else if ((pId == PlatformID.Unix) || (pId == (PlatformID)4)) { string pIdString = DetectUnixKernel(); // Distinguish between Unix and Mac OS X kernels. switch (pIdString) { case "Unix": case "Linux": _GetProcAddress = new GetProcAddressX11(); break; case "Darwin": _GetProcAddress = new GetProcAddressOSX(); break; } } }
/// <summary> /// Static constructor. /// </summary> static GetProcAddress() { switch (Environment.OSVersion.Platform) { case PlatformID.Win32NT: case PlatformID.Win32Windows: case PlatformID.Win32S: case PlatformID.WinCE: _GetProcAddress = new GetProcAddressWindows(); break; case PlatformID.Unix: string unixName = DetectUnixKernel(); // Distinguish between Unix and Mac OS X kernels. switch (unixName) { case "Unix": case "Linux": _GetProcAddress = new GetProcAddressX11(); break; case "Darwin": _GetProcAddress = new GetProcAddressOSX(); break; case null: throw new NotSupportedException(String.Format("Unix platform not detected")); default: throw new NotSupportedException(String.Format("Unix platform {0} not supported", unixName)); } break; case PlatformID.MacOSX: _GetProcAddress = new GetProcAddressOSX(); break; default: throw new NotSupportedException(String.Format("platform {0} not supported", Environment.OSVersion.Platform)); } }
/// <summary> /// Static constructor. /// </summary> static GetProcAddress() { _GetProcAddress = new GetProcAddressWindows(); }