MCPcopy Create free account
hub / github.com/assimp/assimp / OnSetupTextureView

Method OnSetupTextureView

tools/assimp_view/Display.cpp:977–1094  ·  view source on GitHub ↗

-------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

975}
976//-------------------------------------------------------------------------------
977int CDisplay::OnSetupTextureView(TextureInfo* pcNew)
978{
979 ai_assert(nullptr != pcNew);
980
981 if (this->m_pcCurrentTexture == pcNew)return 2;
982
983 if (VIEWMODE_NODE == this->m_iViewMode)
984 {
985 ShowNormalUIComponents();
986 }
987
988 if ((aiTextureType_OPACITY | 0x40000000) == pcNew->iType)
989 {
990 // for opacity textures display a warn message
991 CLogDisplay::Instance().AddEntry("[INFO] This texture is not existing in the "
992 "original mesh",D3DCOLOR_ARGB(0xFF,0xFF,0xFF,0));
993 CLogDisplay::Instance().AddEntry("It is a copy of the alpha channel of the first "
994 "diffuse texture",D3DCOLOR_ARGB(0xFF,0xFF,0xFF,0));
995 }
996
997 // check whether the pattern background effect is supported
998 if (g_sCaps.PixelShaderVersion < D3DPS_VERSION(3,0))
999 {
1000 CLogDisplay::Instance().AddEntry("[WARN] The background shader won't work "
1001 "on your system, it required PS 3.0 hardware. A default color is used ...",
1002 D3DCOLOR_ARGB(0xFF,0xFF,0x00,0));
1003 }
1004
1005 this->m_fTextureZoom = 1000.0f;
1006 this->m_vTextureOffset.x = this->m_vTextureOffset.y = 0.0f;
1007
1008 this->m_pcCurrentTexture = pcNew;
1009 this->SetViewMode(VIEWMODE_TEXTURE);
1010
1011 // now ... change the meaning of the statistics fields
1012 SetWindowText(GetDlgItem(g_hDlg,IDC_NUMVERTS),"Width:");
1013 SetWindowText(GetDlgItem(g_hDlg,IDC_NUMNODES),"Height:");
1014 SetWindowText(GetDlgItem(g_hDlg,IDC_NUMFACES),"Format:");
1015 SetWindowText(GetDlgItem(g_hDlg,IDC_NUMSHADERS),"MIPs:");
1016 SetWindowText(GetDlgItem(g_hDlg,IDC_NUMMATS),"UV:");
1017 SetWindowText(GetDlgItem(g_hDlg,IDC_NUMMESHES),"Blend:");
1018 SetWindowText(GetDlgItem(g_hDlg,IDC_LOADTIME),"Op:");
1019
1020 // and fill them with data
1021 D3DSURFACE_DESC sDesc;
1022 if (pcNew->piTexture && *pcNew->piTexture) {
1023 (*pcNew->piTexture)->GetLevelDesc(0,&sDesc);
1024 char szTemp[128];
1025
1026 sprintf(szTemp,"%i",sDesc.Width);
1027 SetWindowText(GetDlgItem(g_hDlg,IDC_EVERT),szTemp);
1028
1029 sprintf(szTemp,"%i",sDesc.Height);
1030 SetWindowText(GetDlgItem(g_hDlg,IDC_ENODEWND),szTemp);
1031
1032 sprintf(szTemp,"%i",(*pcNew->piTexture)->GetLevelCount());
1033 SetWindowText(GetDlgItem(g_hDlg,IDC_ESHADER),szTemp);
1034

Callers

nothing calls this directly

Calls 5

SetViewModeMethod · 0.95
ShowNormalUIComponentsFunction · 0.85
InstanceClass · 0.85
UpdateColorFieldsInUIFunction · 0.85
AddEntryMethod · 0.45

Tested by

no test coverage detected