本文整理汇总了C++中CModelerView::OnRendUseTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ CModelerView::OnRendUseTexture方法的具体用法?C++ CModelerView::OnRendUseTexture怎么用?C++ CModelerView::OnRendUseTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModelerView
的用法示例。
在下文中一共展示了CModelerView::OnRendUseTexture方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnFileAddTexture
void CModelerDoc::OnFileAddTexture()
{
CModelerView *pModelerView = CModelerView::GetActiveView();
if( pModelerView == NULL)
return;
// call file requester for adding textures
CDynamicArray<CTFileName> afnTextures;
CTFileName fnDocName = CTString(GetPathName());
theApp.WriteProfileString( "Scape", "Add texture directory", fnDocName.FileDir());
_EngineGUI.FileRequester( "Choose textures to add", FILTER_TEX FILTER_END,
"Add texture directory", "Textures\\", fnDocName.FileName()+".tex", &afnTextures);
MEX mexWidth, mexHeight;
m_emEditModel.edm_md.GetTextureDimensions( mexWidth, mexHeight);
// add selected textures
FOREACHINDYNAMICARRAY( afnTextures, CTFileName, itTexture)
{
CTextureDataInfo *pNewTDI;
// add texture
CTFileName fnTexName = itTexture.Current();
try
{
pNewTDI =m_emEditModel.AddTexture_t( fnTexName, mexWidth, mexHeight);
}
catch( char *err_str)
{
pNewTDI = NULL;
AfxMessageBox( err_str);
}
if( pNewTDI != NULL)
{
SetModifiedFlag();
pModelerView->m_ptdiTextureDataInfo = pNewTDI;
// switch to texture mode
pModelerView->OnRendUseTexture();
UpdateAllViews( NULL);
}
}
示例2: OnFileCreateTexture
void CMainFrame::OnFileCreateTexture()
{
CModelerView *pView = (CModelerView *) CModelerView::GetActiveView();
CModelerDoc *pDoc = NULL;
if( pView != NULL)
{
pDoc = pView->GetDocument();
// setup create texture directory
theApp.WriteProfileString("Scape", KEY_NAME_CREATE_TEXTURE_DIR,
_fnmApplicationPath+pDoc->GetModelDirectory());
}
// call create texture dialog
CTFileName fnCreated = _EngineGUI.CreateTexture();
if( (fnCreated != "") && pDoc != NULL)
{
CTextureDataInfo *pNewTDI;
try
{
pNewTDI = pDoc->m_emEditModel.AddTexture_t( fnCreated,
pDoc->m_emEditModel.GetWidth(),
pDoc->m_emEditModel.GetHeight() );
}
catch( char *err_str)
{
AfxMessageBox( err_str);
pNewTDI = NULL;
}
if( pNewTDI != NULL)
{
pDoc->SetModifiedFlag();
pView->m_ptdiTextureDataInfo = pNewTDI;
// switch to texture mode
pView->OnRendUseTexture();
}
}
}