GraphicsDeviceContainer.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. #include <IUnityGraphics.h>
  3. #include <IUnityRenderingExtensions.h>
  4. #include <gmock/gmock.h>
  5. #include <gtest/gtest.h>
  6. #include "PlatformBase.h"
  7. namespace unity
  8. {
  9. namespace webrtc
  10. {
  11. class IGraphicsDevice;
  12. class GraphicsDeviceContainer
  13. {
  14. public:
  15. GraphicsDeviceContainer(UnityGfxRenderer renderer);
  16. ~GraphicsDeviceContainer();
  17. IGraphicsDevice* device() { return device_.get(); }
  18. private:
  19. std::unique_ptr<IGraphicsDevice> device_;
  20. UnityGfxRenderer renderer_;
  21. void* nativeGfxDevice_;
  22. };
  23. std::unique_ptr<GraphicsDeviceContainer> CreateGraphicsDeviceContainer(UnityGfxRenderer renderer);
  24. static UnityGfxRenderer supportedGfxDevices[] = {
  25. #if SUPPORT_D3D11
  26. kUnityGfxRendererD3D11,
  27. #endif // SUPPORT_D3D11
  28. #if SUPPORT_D3D12
  29. kUnityGfxRendererD3D12,
  30. #endif // SUPPORT_D3D12
  31. #if SUPPORT_METAL
  32. kUnityGfxRendererMetal,
  33. #endif // SUPPORT_METAL
  34. // todo::(kazuki) windows support
  35. #if SUPPORT_OPENGL_UNIFIED & UNITY_LINUX
  36. kUnityGfxRendererOpenGLCore,
  37. #endif // SUPPORT_OPENGL_UNIFIED
  38. #if SUPPORT_OPENGL_ES
  39. kUnityGfxRendererOpenGLES30,
  40. #endif // SUPPORT_OPENGL_ES
  41. #if SUPPORT_VULKAN
  42. kUnityGfxRendererVulkan,
  43. #endif // SUPPORT_VULKAN
  44. };
  45. } // end namespace webrtc
  46. } // end namespace unity