本文整理汇总了C++中GraphicsWindow::GetInterface方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsWindow::GetInterface方法的具体用法?C++ GraphicsWindow::GetInterface怎么用?C++ GraphicsWindow::GetInterface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsWindow
的用法示例。
在下文中一共展示了GraphicsWindow::GetInterface方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDevice
static LPDIRECT3DDEVICE9 GetDevice()
{
GraphicsWindow *GW;
ViewExp *View;
LPDIRECT3DDEVICE9 Device;
View = GetCOREInterface()->GetActiveViewport();
if(View)
{
GW = View->getGW();
if(GW)
{
ID3D9GraphicsWindow *D3DGW = (ID3D9GraphicsWindow *)GW->GetInterface(D3D9_GRAPHICS_WINDOW_INTERFACE_ID);
if(D3DGW)
{
Device = D3DGW->GetDevice();
return(Device);
}
}
}
return NULL;
}
示例2: GetDevice
static LPDIRECT3DDEVICE9 GetDevice()
{
#ifndef NO_ASHLI
GraphicsWindow *lpGW = NULL;
static LPDIRECT3DDEVICE9 lpDevice = NULL;
if(lpDevice)
return lpDevice;
ViewExp& lpView = GetCOREInterface()->GetActiveViewExp();
if(lpView.IsAlive())
{
lpGW = lpView.getGW();
if(lpGW)
{
ID3D9GraphicsWindow *lpD3DGW = (ID3D9GraphicsWindow *)lpGW->GetInterface(D3D9_GRAPHICS_WINDOW_INTERFACE_ID);
if(lpD3DGW)
{
lpDevice = lpD3DGW->GetDevice();
}
}
}
return lpDevice;
#else
return NULL;
#endif
}
示例3: CheckForDX
BOOL CheckForDX()
{
static bool firstcheck = true; // ~Wenle: this function get called for the first time?
static bool checkresult = false; // ~Wenle: the check result is cached here
if (firstcheck)
{
firstcheck = false;
ViewExp &vpt = GetCOREInterface()->GetActiveViewExp();
if (vpt.IsAlive())
{
GraphicsWindow *gw = vpt.getGW();
if (gw && gw->querySupport(GW_SPT_GEOM_ACCEL))
{
IHardwareShader * phs = (IHardwareShader*)gw->GetInterface(HARDWARE_SHADER_INTERFACE_ID);
if (phs)
checkresult = true;
}
}
}
return checkresult;
}
示例4:
Value*
setDirectXDisplayAllTriangle_cf(Value** arg_list, int count)
{
check_arg_count(setDirectXDisplayAllTriangle, 1, count);
GraphicsWindow *gw = MAXScript_interface->GetActiveViewExp().getGW();
if (MaxSDK::Graphics::IsRetainedModeEnabled() && gw->querySupport(GW_SPT_NUM_LIGHTS) == 0)
{
return &undefined;
}
IHardwareRenderer *phr = (IHardwareRenderer *)gw->GetInterface(HARDWARE_RENDERER_INTERFACE_ID);
if (phr)
{
BOOL displayAllEdges = arg_list[0]->to_bool();
if (displayAllEdges)
phr->SetDisplayAllTriangleEdges(true);
else phr->SetDisplayAllTriangleEdges(false);
}
return &ok;
}
示例5: LoadEffectsList
void ViewportLoader::LoadEffectsList()
{
// loads static shader list with name-sorted Shader ClassDesc*'s
bool bdx9 = false;
GraphicsWindow *gw = NULL;
ViewExp& vpt = GetCOREInterface()->GetActiveViewExp();
if(vpt.IsAlive())
{
gw = vpt.getGW();
if(gw && gw->GetInterface(D3D9_GRAPHICS_WINDOW_INTERFACE_ID))
{
bdx9 = true;
}
}
effectsList.ZeroCount();
SubClassList* scList = GetCOREInterface()->GetDllDir().ClassDir().GetClassList(REF_TARGET_CLASS_ID);
theHold.Suspend(); // LAM - 3/24/03 - defect 446356 - doing a DeleteThis on created effects, need to make sure hold is off
for (long i = 0, j = 0; i < scList->Count(ACC_ALL); ++i) {
if ( (*scList)[ i ].IsPublic() ) {
ClassDesc* pClassD = (*scList)[ i ].CD();
const TCHAR *cat = pClassD->Category();
TCHAR *defcat = GetString(IDS_DX_VIEWPORT_EFFECT);
if ((cat) && (_tcscmp(cat,defcat) == 0))
{
ReferenceTarget * effect = (ReferenceTarget *)pClassD->Create(TRUE);
if(effect)
{
IDX9DataBridge * vp = (IDX9DataBridge*)effect->GetInterface(VIEWPORT_SHADER9_CLIENT_INTERFACE);
if( vp)
{
if(bdx9)
{
if(vp->GetDXVersion() >=9.0f || vp->GetDXVersion() == 1.0f)
{
effectsList.Append(1, &pClassD);
}
}
else
{
if(vp->GetDXVersion() < 9.0f)
{
effectsList.Append(1, &pClassD);
}
}
}
else
{
IDXDataBridge * vp = (IDXDataBridge*)effect->GetInterface(VIEWPORT_SHADER_CLIENT_INTERFACE);
if(vp && !bdx9)
{
effectsList.Append(1, &pClassD);
}
}
effect->MaybeAutoDelete();
}
}
}
}
theHold.Resume();
effectsList.Sort(&classDescListCompare);
}