void PaintDeformTest::BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev ) { this->ip = ip; PaintDeformTestDesc.BeginEditParams(ip, this, flags, prev); paintdeformtest_param_blk.SetUserDlgProc(new PaintDeformTestDlgProc(this)); pPainter = NULL; ReferenceTarget *painterRef = (ReferenceTarget *) GetCOREInterface()->CreateInstance(REF_TARGET_CLASS_ID,PAINTERINTERFACE_CLASS_ID); //set it to the correct verion if (painterRef) { pPainter = (IPainterInterface_V7 *) painterRef->GetInterface(PAINTERINTERFACE_V7); } TimeValue t = ip->GetTime(); NotifyDependents(Interval(t,t), PART_ALL, REFMSG_BEGIN_EDIT); NotifyDependents(Interval(t,t), PART_ALL, REFMSG_MOD_DISPLAY_ON); SetAFlag(A_MOD_BEING_EDITED); }
void PainterTextureSample::InitUI(HWND hWnd) { hwnd = hWnd; if (iPaintButton) ReleaseICustButton(iPaintButton); iPaintButton = NULL; iPaintButton = GetICustButton(GetDlgItem(hWnd,IDC_PAINT)); iPaintButton->SetType(CBT_CHECK); iPaintButton->SetHighlightColor(GREEN_WASH); pPainter = NULL; ReferenceTarget *painterRef = (ReferenceTarget *) GetCOREInterface()->CreateInstance(REF_TARGET_CLASS_ID,PAINTERINTERFACE_CLASS_ID); //set it to the correct verion if (painterRef) { pPainter = (IPainterInterface_V5 *) painterRef->GetInterface(PAINTERINTERFACE_V5); } }
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); }