/*
Copyright (C) 2010, Heikki Salo
All rights reserved.
Distributed under the BSD license:
http://www.opensource.org/licenses/bsd-license.php
*/
#include "stdafx.h"
#include "DPBase.hpp"
/*
// {034B6412-DE82-499e-8743-2630788C1DF9}
static const GUID DIRECTPYTHON_GUID =
{ 0x34b6412, 0xde82, 0x499e, { 0x87, 0x43, 0x26, 0x30, 0x78, 0x8c, 0x1d, 0xf9 } };
*/
DPBase::~DPBase()
{
SafeRelease(immediateContext);
SafeRelease(d3d11device);
}
void DPBase::init(ID3D11DeviceChild* resource)
{
if (d3d11device)
DPThrow("DPBase already initialized");
resource->GetDevice(&d3d11device);
d3d11device->GetImmediateContext(&immediateContext);
}
void DPBase::init(ID3D11Device* dev)
{
if (d3d11device)
DPThrow("DPBase already initialized");
d3d11device = dev;
d3d11device->AddRef();
d3d11device->GetImmediateContext(&immediateContext);
}
/*
void DPBase::saveSelf(ID3D11DeviceChild* devChild)
{
void* selfPtr = this;
TestHR(devChild->SetPrivateData(DIRECTPYTHON_GUID, sizeof(selfPtr), &selfPtr));
}
DPBase* DPBase::getSelf()
{
return 0;
}*/