Sign in to follow this  
AvengerDr

DirectX11 and Stereo, how to get a Surface object for Direct2D?

Recommended Posts

AvengerDr    751
Hi all,
I am trying to implement a stereoscopic 3D application. To start, I am porting the related MSDN stereoscopic 3D sample.
 
I was able to activate the emitter and actually see something in 3D. However I am not able to create the D2D BitmapTargets. It crashes on this line:
 
using (var dxgiBackBuffer = swapChain.GetBackBuffer<SharpDX.DXGI.Surface>(0)) 

It seems that in a S3D app, that will not work. In the actual sample they are calling:

 
 // Direct2D needs the dxgi version of the backbuffer surface pointer.
    ComPtr<IDXGIResource1> dxgiBackBuffer;
    DX::ThrowIfFailed(
        m_swapChain->GetBuffer(0, IID_PPV_ARGS(&dxgiBackBuffer))
        );
 
    ComPtr<IDXGISurface2> dxgiSurface;
    DX::ThrowIfFailed(
        dxgiBackBuffer->CreateSubresourceSurface(0, &dxgiSurface)
        );
// then they create the two bitmap targets
However in SharpDX it seems that the method CreateSubresourceSurface is missing from the Resource1 class. Does anyone know if there is any other way to get that object so I can create the BitmapTarget objects?
 
Thanks in advance.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this