Message 1 of 4
Applying a bitmap image to a texture

Not applicable
12-02-2011
11:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I am using the following code in a SceneImport plugin.
Subsequently this texture is applied to a material. The appropriate bitmaps are initially visible on the scene materials in the material editor (as well as on the imported model when I use the "Standard display with maps" option on the menu), but the "view image" button in the material editor does nothing. And if I click "Reload" the texture disappears. It's obvious one or more extra function calls are missing; what could they be?
Btw I could have skipped creating a Bitmap and BitmapInfo and just used "SetMapName". Works fine at times but this occasionally causes crashes (probably because of invalid Bitmap* pointer).
I am using the following code in a SceneImport plugin.
BitMapTex* theTex= NewDefaultBitmapTex();
BitmapInfo bi;
Bitmap* bmap;
bi.SetName(longFileName);
bmap= TheManager->Load(&bi);
theTex->SetBitmapInfo(bi); //set Bitmap info first
theTex->SetBitmap(bmap);
Subsequently this texture is applied to a material. The appropriate bitmaps are initially visible on the scene materials in the material editor (as well as on the imported model when I use the "Standard display with maps" option on the menu), but the "view image" button in the material editor does nothing. And if I click "Reload" the texture disappears. It's obvious one or more extra function calls are missing; what could they be?
Btw I could have skipped creating a Bitmap and BitmapInfo and just used "SetMapName". Works fine at times but this occasionally causes crashes (probably because of invalid Bitmap* pointer).