Re: Irrlicht with cubemap support
Posted: Tue Oct 25, 2016 12:37 pm
Hello!
I'm using a recent trunk version of Irrlicht (Direct3D 9 driver) with the cubemap support. In my case the display window can be closed and reopened by the application, so the irrlicht device can be opened/closed multiple times. If I'm using cubemaps, a strange memory leak appears. I create the cubemap the following way:
So far so good, the leak only appears if I try to assign it to a material:
If I comment this out the leak disappears. The size of the leak seams to be equal to the size of the 6 textures (1024*1024*4*6=~25MB) according to Visual Studio memory snapshots. I tried to look at the code of the Direct3D driver, but I can't find any apperent reason for this phenomenon. Could it be a bug in Irrlicht, or am I doing something wrong?
I'm using a recent trunk version of Irrlicht (Direct3D 9 driver) with the cubemap support. In my case the display window can be closed and reopened by the application, so the irrlicht device can be opened/closed multiple times. If I'm using cubemaps, a strange memory leak appears. I create the cubemap the following way:
Code: Select all
irr::video::IImage* cubeImages[6];
cubeImages[0] = driver->createImageFromFile("cube/pos-x.png");
cubeImages[1] = driver->createImageFromFile("cube/neg-x.png"),
cubeImages[2] = driver->createImageFromFile("cube/pos-y.png"),
cubeImages[3] = driver->createImageFromFile("cube/neg-y.png"),
cubeImages[4] = driver->createImageFromFile("cube/neg-z.png"),
cubeImages[5] = driver->createImageFromFile("cube/pos-z.png");
cubemapTexture = driver->addTextureCubemap("environmentMap", cubeImages[0], cubeImages[1], cubeImages[2], cubeImages[3], cubeImages[4], cubeImages[5]);
for (int i = 0; i < 6; i++)
cubeImages[i]->drop();
Code: Select all
node->setMaterialTexture(4, cubemapTexture);