addRenderTargetTexture causes error

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Riktovitch
Posts: 15
Joined: Tue Mar 05, 2013 12:36 am

addRenderTargetTexture causes error

Post by Riktovitch »

Code: Select all

#include <iostream>
#include <irrlicht.h>
 
#pragma comment(lib, "Irrlicht.lib")
 
int main()
{
    irr::IrrlichtDevice *device = irr::createDevice(irr::video::E_DRIVER_TYPE::EDT_OPENGL);
 
    if (device)
    {
        irr::video::IVideoDriver *driver = device->getVideoDriver();
 
        device->run();
 
        std::cout << std::hex;
 
        for (irr::u32 i = 0; i < 16; i++)
        {
            std::cout << "ADD" << std::endl;
 
            irr::video::ITexture *rtt = driver->addRenderTargetTexture(irr::core::dimension2du(1024, 1024));
 
            std::cout << "[" << i << "] " << rtt << std::endl;
 
            if (rtt && i >= 8) // Only remove the texture if i >= 8
            {
                std::cout << "REMOVE" << std::endl;
                driver->removeTexture(rtt);
            }
        }
 
        std::cout << std::dec;
 
        while (device->run())
        {
            driver->beginScene();
            driver->endScene();
        }
 
        device->drop();
    }
 
    system("pause");
}
Hi, I've tested this on three different computers and it produces the same result. After removeTexture is called for the first time, FBO missing an image attachment is printed to the console for every subsequent addRenderTargetTexture. This is with the latest SVN (rev 4727). It doesn't happen on the stable release, and between OpenGL and Direct3D9 it only happens in OpenGL. (also, I'm on Windows 7 x64)

Code: Select all

FBO missing an image attachment
FBO error
GL_INVALID_OPERATION
FBO missing an image attachment
FBO error
GL_INVALID_OPERATION
FBO missing an image attachment
FBO error
Post Reply