OpenGLContext.h 551 B

123456789101112131415161718192021
  1. #pragma once
  2. namespace unity
  3. {
  4. namespace webrtc
  5. {
  6. class OpenGLContext
  7. {
  8. public:
  9. // Call the function on the render thread in Unity.
  10. static void Init();
  11. // Create the context related the thread.
  12. // Throw exception when the context is already created on the thread.
  13. static std::unique_ptr<OpenGLContext> CreateGLContext(const OpenGLContext* shared = nullptr);
  14. // Whether the context has been created on the thread.
  15. static std::unique_ptr<OpenGLContext> CurrentContext();
  16. };
  17. }
  18. }