|
// Copyright (c) Microsoft Corporation. All rights reserved.
#include "stdafx.h"
#include "D3D10EffectConstantBuffer.h"
#include "D3D10Buffer.h"
#include "D3D10ShaderResourceView.h"
using namespace Microsoft::WindowsAPICodePack::DirectX::Direct3D10;
D3DBuffer^ EffectConstantBuffer::GetConstantBuffer()
{
ID3D10Buffer* tempoutConstantBuffer = NULL;
CommonUtils::VerifyResult(GetInterface<ID3D10EffectConstantBuffer>()->GetConstantBuffer(&tempoutConstantBuffer));
return tempoutConstantBuffer == NULL ? nullptr : gcnew D3DBuffer(tempoutConstantBuffer);
}
ShaderResourceView^ EffectConstantBuffer::GetTextureBuffer()
{
ID3D10ShaderResourceView* tempoutTextureBuffer = NULL;
CommonUtils::VerifyResult(GetInterface<ID3D10EffectConstantBuffer>()->GetTextureBuffer(&tempoutTextureBuffer));
return tempoutTextureBuffer == NULL ? nullptr : gcnew ShaderResourceView(tempoutTextureBuffer);
}
void EffectConstantBuffer::SetConstantBuffer(D3DBuffer^ constantBuffer)
{
CommonUtils::CheckNull(constantBuffer, "constantBuffer");
CommonUtils::VerifyResult(GetInterface<ID3D10EffectConstantBuffer>()->SetConstantBuffer(constantBuffer->GetInterface<ID3D10Buffer>()));
}
void EffectConstantBuffer::SetTextureBuffer(ShaderResourceView^ textureBuffer)
{
CommonUtils::CheckNull(textureBuffer, "textureBuffer");
CommonUtils::VerifyResult(GetInterface<ID3D10EffectConstantBuffer>()->SetTextureBuffer(textureBuffer->GetInterface<ID3D10ShaderResourceView>()));
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
John graduated from the University of South Australia in 1997 with a Bachelor of Electronic Engineering Degree, and since then he has worked on hardware and software in many fields including Aerospace, Defence, and Medical giving him over 10 of years experience in C++ and C# programming. In 2009 John Started his own contracting company doing business between Taiwan and Australia.