Menu

[025cc2]: / DirectPython11 / DPBase.cpp  Maximize  Restore  History

Download this file

54 lines (43 with data), 1.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
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;
}*/
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.