IOpenGLContext.cs 649 B

123456789101112131415161718192021222324252627
  1. using Ryujinx.Graphics.OpenGL.Helper;
  2. using System;
  3. namespace Ryujinx.Graphics.OpenGL
  4. {
  5. public interface IOpenGLContext : IDisposable
  6. {
  7. void MakeCurrent();
  8. // TODO: Support more APIs per platform.
  9. static bool HasContext()
  10. {
  11. if (OperatingSystem.IsWindows())
  12. {
  13. return WGLHelper.GetCurrentContext() != IntPtr.Zero;
  14. }
  15. else if (OperatingSystem.IsLinux())
  16. {
  17. return GLXHelper.GetCurrentContext() != IntPtr.Zero;
  18. }
  19. else
  20. {
  21. return false;
  22. }
  23. }
  24. }
  25. }