当前位置: 首页>>代码示例>>C++>>正文


C++ CModelerView::OnRendUseTexture方法代码示例

本文整理汇总了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);
    }
  }
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:38,代码来源:ModelerDoc.cpp

示例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();
    }
  }
}
开发者ID:RocketersAlex,项目名称:LCSource,代码行数:36,代码来源:MainFrm.cpp


注:本文中的CModelerView::OnRendUseTexture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。