Direct3DContentProvider.h 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include "pch.h"
  3. #include <wrl/module.h>
  4. #include <Windows.Phone.Graphics.Interop.h>
  5. #include <DrawingSurfaceNative.h>
  6. #include "Direct3DInterop.h"
  7. class Direct3DContentProvider : public Microsoft::WRL::RuntimeClass<
  8. Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::WinRtClassicComMix>,
  9. ABI::Windows::Phone::Graphics::Interop::IDrawingSurfaceContentProvider,
  10. IDrawingSurfaceContentProviderNative>
  11. {
  12. public:
  13. Direct3DContentProvider(PhoneXamlDirect3DApp1Comp::Direct3DInterop^ controller);
  14. void ReleaseD3DResources();
  15. // IDrawingSurfaceContentProviderNative
  16. HRESULT STDMETHODCALLTYPE Connect(_In_ IDrawingSurfaceRuntimeHostNative* host);
  17. void STDMETHODCALLTYPE Disconnect();
  18. HRESULT STDMETHODCALLTYPE PrepareResources(_In_ const LARGE_INTEGER* presentTargetTime, _Out_ BOOL* contentDirty);
  19. HRESULT STDMETHODCALLTYPE GetTexture(_In_ const DrawingSurfaceSizeF* size, _Out_ IDrawingSurfaceSynchronizedTextureNative** synchronizedTexture, _Out_ DrawingSurfaceRectF* textureSubRectangle);
  20. private:
  21. HRESULT InitializeTexture(_In_ const DrawingSurfaceSizeF* size);
  22. PhoneXamlDirect3DApp1Comp::Direct3DInterop^ m_controller;
  23. Microsoft::WRL::ComPtr<IDrawingSurfaceRuntimeHostNative> m_host;
  24. Microsoft::WRL::ComPtr<IDrawingSurfaceSynchronizedTextureNative> m_synchronizedTexture;
  25. };