How to create a dynamic cube-map

 // Create the texture with six times the height (because of the six cubemap faces).
 const s32 CubeMapSize = 256;
 video::Texture* CubeMap = spRenderer->createTexture(dim::size2di(CubeMapSize, CubeMapSize*6));
 
 // Configure the cubemap texture and convert it to a render-target texture.
 CubeMap->setDimension(video::TEXTURE_CUBEMAP);
 CubeMap->setWrapMode(video::TEXWRAP_CLAMP);
 CubeMap->setRenderTarget(true);
 
 // Add the cubemap to the object and configure texture coordinate generation.
 MeshObject->addTexture(CubeMap);
 MeshObject->getMeshBuffer(0)->setMappingGen(0, video::MAPGEN_REFLECTION_MAP);
 
 // ...
 
 // Update the cubemap every frame (or only each second frame to save performance).
 MeshObject->setVisible(false);
 spRenderer->updateCubeMap(CubeMap, MeshObject->getPosition(true));
 MeshObject->setVisible(true);
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines