/*******************************************************************************
* DTBase.cpp *
*------------*
* Description:
* This module contains the CDXBaseNTo1 transform
*-------------------------------------------------------------------------------
* Created By: Edward W. Connell Date: 07/28/97
* Copyright (C) 1997 Microsoft Corporation
* All Rights Reserved
*
*-------------------------------------------------------------------------------
* Revisions:
*
*******************************************************************************/
//--- Additional includes
#include "stdafx.h"
#include <DXTrans.h>
#include "DTBase.h"
#include "new.h"
//--- Initialize static member of debug scope class
#ifdef _DEBUG
CDXTDbgFlags CDXTDbgScope::m_DebugFlags;
#endif
//--- This should only be used locally in this file. We duplicated this GUID
// value to avoid having to include DDraw.
static const IID IID_IDXDupDirectDraw =
{ 0x6C14DB80,0xA733,0x11CE, { 0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 } };
static const IID IID_IDXDupDDrawSurface =
{ 0x6C14DB81,0xA733,0x11CE, { 0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 } };
static const IID IID_IDXDupDirect3DRM =
{0x2bc49361, 0x8327, 0x11cf, {0xac, 0x4a, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1 } };
static const IID IID_IDXDupDirect3DRM3 =
{0x4516ec83, 0x8f20, 0x11d0, {0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3 } };
static const IID IID_IDXDupDirect3DRMMeshBuilder3 =
{ 0x4516ec82, 0x8f20, 0x11d0, { 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3} };
HRESULT CDXDataPtr::Assign(BOOL bMesh, IUnknown * pObject, IDXSurfaceFactory *pSurfaceFactory)
{
HRESULT hr = S_OK;
if (pObject)
{
IUnknown *pNative = NULL;
if (!bMesh)
{
//--- Try to get a DX surface
hr = pObject->QueryInterface( IID_IDXSurface, (void **)&pNative );
if( FAILED( hr ) )
{
IDirectDrawSurface *pSurf;
//--- Try to get a DDraw surface
hr = pObject->QueryInterface( IID_IDXDupDDrawSurface, (void **)&pSurf );
if( SUCCEEDED( hr ) )
{
//--- Create a DXSurface from the DDraw surface
hr = pSurfaceFactory->CreateFromDDSurface(
pSurf, NULL, 0, NULL, IID_IDXSurface,
(void **)&pNative );
pSurf->Release();
}
}
}
else // Must be a mesh builder
{
hr = pObject->QueryInterface(IID_IDXDupDirect3DRMMeshBuilder3, (void **)&pNative);
}
if (SUCCEEDED(hr))
{
Release();
m_pNativeInterface = pNative;
pObject->AddRef();
m_pUnkOriginalObject = pObject;
if (SUCCEEDED(pNative->QueryInterface(IID_IDXBaseObject, (void **)&m_pBaseObj)))
{
m_pBaseObj->GetGenerationId(&m_dwLastDirtyGenId);
m_dwLastDirtyGenId--;
}
if (!bMesh)
{
((IDXSurface *)pNative)->GetPixelFormat(NULL, &m_SampleFormat);
}
}
else
{
if (hr == E_NOINTERFACE)
{
hr = E_INVALIDARG;
}
}
}
else
{
Release();
}
return hr;
} /* CDXDataPtr::Assign */
bool CDXDataPtr::IsDirty(void)
{
if (m_pBaseObj)
{
DWORD dwOldId = m_dwLastDirtyGenId;
m_pBaseObj->GetGenerationId(&m_dwLastDirtyGenId);
return dwOldId != m_dwLastDirtyGenId;
}
else
{
return false;
}
}
DWORD CDXDataPtr::GenerationId(void)
{
if (m_pBaseObj)
{
DWORD dwGenId;
m_pBaseObj->GetGenerationId(&dwGenId);
return dwGenId;
}
else
{
return 0;
}
}
bool CDXDataPtr::UpdateGenerationId(void)
{
if (m_pBaseObj)
{
DWORD dwOldId = m_dwLastUpdGenId;
m_pBaseObj->GetGenerationId(&m_dwLastUpdGenId);
return dwOldId != m_dwLastUpdGenId;
}
else
{
return false;
}
} /* CDXDataPtr::UpdateGenerationId */
ULONG CDXDataPtr::ObjectSize(void)
{
ULONG ulSize = 0;
if (m_pBaseObj)
{
m_pBaseObj->GetObjectSize(&ulSize);
}
return ulSize;
}
/*****************************************************************************
* CDXBaseNTo1::CDXBaseNTo1 *
*--------------------------*
* Description:
* Constructor
*-----------------------------------------------------------------------------
* Created By: Ed Connell Date: 07/28/97
*-----------------------------------------------------------------------------
* Parameters:
*****************************************************************************/
CDXBaseNTo1::CDXBaseNTo1() :
m_aInputs(NULL),
m_ulNumInputs(0),
m_ulNumProcessors(1), // Default to one until task manager is set
m_dwGenerationId(1),
m_dwCleanGenId(0),
m_Duration(1.0f),
m_StepResolution(0.0f),
m_Progress(0.0f),
m_dwBltFlags(0),
m_bPickDoneByBase(false),
m_bInMultiThreadWorkProc(FALSE),
m_fQuality(0.5f), // Default to normal quality.
// Wait forever before timing out on a lock by default
m_ulLockTimeOut(INFINITE),
//
// Override these flags if your object does not support one or more of these options.
// Typically, 3-D effects should set this member to 0.
//
m_dwMiscFlags(DXTMF_BLEND_WITH_OUTPUT | DXTMF_DITHER_OUTPUT |
DXTMF_BLEND_SUPPORTED | DXTMF_DITHER_SUPPORTED | DXTMF_BOUNDS_SUPPORTED | DXTMF_PLACEMENT_SUPPORTED),
//
// If your object has a different number of objects or a different number of
// required objects than 1, simply set these members in the body of your
// constructor or in FinalConstruct(). For every input that is > the number
// required, that input will be reported as optional.
//
// If your transform takes 2 required inputs, set both to 2.
// If your transform takes 2 optional inputs, set MaxInputs = 2, NumInRequired = 0
// If your transform takes 1 required and 2 optional inputs,
// set MaxInputs = 2, NumInRequired = 1
//
// For more complex combinations of optinal/required, you will need to override
// the OnSetup method of this base class, and override the methods
// GetInOutInfo
//
m_ulMaxInputs(1),
m_ulNumInRequired(1),
//
// If the intputs or output types are not surfaces then set appropriate object type
//
m_dwOptionFlags(0), // Inputs and output are surfaces, don't have to be the same size
m_ulMaxImageBands(DXB_MAX_IMAGE_BANDS)
{
DXTDBG_FUNC( "CDXBaseNTo1::CDXBaseNTo1" );
//
// Set event handles to NULL.
//
memset(m_aEvent, 0, sizeof(m_aEvent));
} /* CDXBaseNTo1::CDXBaseNTo1 */
/*****************************************************************************
* CDXBaseNTo1::~CDXBaseNTo1 *
*---------------------------*
* Description:
* Constructor
*-----------------------------------------------------------------------------
* Created By: Ed Connell Date: 07/28/97
*-----------------------------------------------------------------------------
* Parameters:
*****************************************************************************/
CDXBaseNTo1::~CDXBaseNTo1()
{
DXTDBG_FUNC( "CDXBaseNTo1::~CDXBaseNTo1" );
_ReleaseReferences();
delete[] m_aInputs;
//--- Release event objects
for(ULONG i = 0; i < DXB_MAX_IMAGE_BANDS; ++i )
{
if( m_aEvent[i] ) ::CloseHandle( m_aEvent[i] );
}
} /* CDXBaseNTo1::~CDXBaseNTo1 */
没有合适的资源?快使用搜索试试~ 我知道了~
1313个C标准库头文件
共1313个文件
h:1265个
inc:13个
c:10个
需积分: 29 57 下载量 197 浏览量
2017-06-28
16:49:28
上传
评论 1
收藏 7.52MB ZIP 举报
温馨提示
自己找到的最全的C标准库头文件
资源推荐
资源详情
资源评论
收起资源包目录
1313个C标准库头文件 (1313个子文件)
danim_i.c 24KB
cdosys_i.c 9KB
dxtguid.c 6KB
agtsvr_i.c 4KB
agtctl_i.c 4KB
cdo_i.c 3KB
mtxadmin_i.c 2KB
mtsadmin_i.c 2KB
esconf_i.c 2KB
exchhndl_i.c 1001B
dtbase.cpp 55KB
dxsurfb.cpp 14KB
dxhelp3.cpp 10KB
oledlg.dlg 27KB
prnsetup.dlg 7KB
fileopen.dlg 7KB
msacmdlg.dlg 3KB
color.dlg 3KB
icmui.dlg 3KB
font.dlg 2KB
findtext.dlg 2KB
mshtmlc.h 3.11MB
mshtml.h 1.51MB
danim.h 1.51MB
sapi.h 856KB
iads.h 795KB
msxml2.h 753KB
tapi3if.h 710KB
strmif.h 646KB
wincrypt.h 634KB
mqoai.h 587KB
winerror.h 582KB
oledb.h 578KB
comsvcs.h 546KB
faxcomex.h 535KB
agtctl.h 528KB
cdoex.h 526KB
agtsvr.h 507KB
adoint.h 489KB
sqldmo.h 488KB
msxml.h 448KB
msclus.h 434KB
objidl.h 419KB
dxtmsft.h 399KB
msctf.h 389KB
mswtecom.h 388KB
control.h 355KB
activdbg.h 323KB
commctrl.h 320KB
cluscfgserver.h 309KB
shldisp.h 298KB
winnt.h 294KB
shobjidl.h 286KB
javadbg.h 278KB
wbemdisp.h 278KB
winuser.h 274KB
sqlole.h 272KB
mmc.h 257KB
exdisp.h 245KB
strsafe.h 239KB
rtccore.h 236KB
ocidl.h 235KB
urlmon.h 230KB
ddraw.h 230KB
tom.h 223KB
dbgeng.h 221KB
netmon.h 220KB
dimm.h 218KB
mshtmdid.h 216KB
oaidl.h 208KB
dxtrans.h 207KB
ksmedia.h 205KB
winbase.h 203KB
xenroll.h 201KB
mmcobj.h 200KB
crsintf.h 195KB
setupapi.h 192KB
adoctint.h 189KB
wingdi.h 178KB
faxcom.h 177KB
tapi.h 171KB
mmsystem.h 171KB
txdtc.h 169KB
cdosys.h 167KB
wbemcli.h 167KB
mlang.h 165KB
dxtmsft3.h 159KB
cdonts.h 157KB
tapi3.h 154KB
cdo.h 152KB
eventsys.h 152KB
mmreg.h 147KB
ks.h 145KB
oleidl.h 143KB
shlobj.h 142KB
vfw.h 140KB
netcon.h 138KB
sapiddk.h 136KB
asptlb.h 136KB
msimcntl.h 133KB
共 1313 条
- 1
- 2
- 3
- 4
- 5
- 6
- 14
资源评论
TEAVAMC
- 粉丝: 714
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功