public GLTextureData(Sizei textureSize, Recti renderViewport, IntPtr texId) { Header.API = RenderAPIType.OpenGL; Header.TextureSize = textureSize; Header.RenderViewport = renderViewport; _texId = texId; }
private static extern sbyte ovrHmd_AttachToWindow( IntPtr hmd, IntPtr window, Recti destMirrorRect, Recti sourceRenderTargetRect);
private static extern void ovrHmd_GetRenderScaleAndOffset( FovPort fov, Sizei textureSize, Recti renderViewport, [MarshalAs(UnmanagedType.LPArray, SizeConst = 2)] [Out] Vector2f[] uvScaleOffsetOut);
/// <summary> /// Computes updated 'uvScaleOffsetOut' to be used with a distortion if render target size or /// viewport changes after the fact. This can be used to adjust render size every frame if desired. /// </summary> public Vector2f[] GetRenderScaleAndOffset(FovPort fov, Sizei textureSize, Recti renderViewport) { Vector2f[] uvScaleOffsetOut = new Vector2f[] { new Vector2f(), new Vector2f() }; ovrHmd_GetRenderScaleAndOffset(fov, textureSize, renderViewport, uvScaleOffsetOut); return uvScaleOffsetOut; }
/// <summary> /// Platform specific function to specify the application window whose output will be /// displayed on the HMD. Only used if the ovrHmdCap_ExtendDesktop flag is false. /// Windows: SwapChain associated with this window will be displayed on the HMD. /// Specify 'destMirrorRect' in window coordinates to indicate an area /// of the render target output that will be mirrored from 'sourceRenderTargetRect'. /// Null pointers mean "full size". /// @note Source and dest mirror rects are not yet implemented. /// </summary> public bool AttachToWindow(Recti destMirrorRect, Recti sourceRenderTargetRect) { return ovrHmd_AttachToWindow(HmdPtr, IntPtr.Zero, destMirrorRect, sourceRenderTargetRect); }
public D3D11TextureData(Sizei textureSize, Recti renderViewport, IntPtr ID3D11Texture2D_pTexture, IntPtr ID3D11ShaderResourceView_pSRView) { Header.API = RenderAPIType.D3D11; Header.TextureSize = textureSize; Header.RenderViewport = renderViewport; _ID3D11Texture2D_pTexture = ID3D11Texture2D_pTexture; _ID3D11ShaderResourceView_pSRView = ID3D11ShaderResourceView_pSRView; }
public D3D9TextureData(Sizei textureSize, Recti renderViewport, IntPtr IDirect3DTexture9_pTexture) { Header.API = RenderAPIType.D3D9; Header.TextureSize = textureSize; Header.RenderViewport = renderViewport; _IDirect3DTexture9_pTexture = IDirect3DTexture9_pTexture; }
/// <summary> /// Platform specific function to specify the application window whose output will be /// displayed on the HMD. Only used if the ovrHmdCap_ExtendDesktop flag is false. /// Windows: SwapChain associated with this window will be displayed on the HMD. /// Specify 'destMirrorRect' in window coordinates to indicate an area /// of the render target output that will be mirrored from 'sourceRenderTargetRect'. /// Null pointers mean "full size". /// @note Source and dest mirror rects are not yet implemented. /// </summary> public bool AttachToWindow(Recti destMirrorRect, Recti sourceRenderTargetRect, IntPtr WindowPtr = default(IntPtr)) { return ovrHmd_AttachToWindow(HmdPtr, WindowPtr, destMirrorRect, sourceRenderTargetRect) != 0; }