getting the run time err from line "loader->LoadTexture " "After GetAllData crystalspace.maploader.parse.image: Could not open image file '' on VFS! crystalspace.maploader.parse.texture: Couldn't load image. Using checkerboard instead! After create Texturewapper Sector:system" void Body::Load_Texture(AppTest* app, std::string filename, std::string mat_name ) { csColor* transp; iTextureList* texturelist; csRef engine = app->GetEngine(); if (!engine) printf("Star::Load_Texture: Failed to locate iEngine renderer!\n"); csRef g3d = app->Get_g3d(); if (!g3d) printf("Body::Load_Image: Failed to locate 3D renderer!\n"); csRef loader = app->Get_Loader(); if (!g3d) printf("Body::Load_Image: Failed to locate 3D renderer!\n"); csRef texture_manager = g3d->GetTextureManager(); if (!texture_manager) printf("Body::Load_Image: Failed to load Texture Manager!\n"); printf("before new File\n"); csRef file = new csPhysicalFile( filename.c_str() ,"rb"); if (!file) printf("Body::Load_Image: Failed to open image file: %s!\n" , filename.c_str() ); csRef buf = file->GetAllData(); printf("After GetAllData\n"); //mat_name.c_str() csRef texturewapper = loader->LoadTexture ( "gstar" , buf, CS_TEXTURE_3D, texture_manager , true, true, true ); printf("After create Texturewapper\n"); iMaterialWrapper* mat = engine->GetMaterialList ()->FindByName (mat_name.c_str()); //mat_name.c_str() if ( !mat ) { printf(" Star::Load_Texture: Material %s not found!\n",mat_name.c_str() ); } // Now add the texture to the mesh if (!mesh->GetMeshObject ()->SetMaterialWrapper (mat)) printf ("Body::Load_Texture: Error SetMaterialWrapper failed\n") ; }