我有一個direct3d項目,使用D3DXCreateTextureFromFile()加載一些圖像。該函數爲文件路徑提供LPCWSTR。我想加載一系列連續編號的紋理(即MyImage0001.jpg,MyImage0002.jpg等),但C++的瘋狂字符串讓我困惑。將整數轉換爲格式化的LPCWSTR。 C++
我該怎麼辦:
for(int i=0; i < 3;i++)
{
//How do I convert i into a string path i can use with D3DXCreateTextureFromFile?
}
編輯:
我要提到我使用Visual Studio 2008的編譯器
+1:比我的好。 – 2010-05-06 01:00:16
這工作,除了我需要前綴L「MyImage ....」 – 2010-05-06 01:05:29
@MrBell - 謝謝,我忘了那個重要的細節。 – 2010-05-06 01:08:27