manuel.gysin Posted March 20, 2014 Posted March 20, 2014 Hello Using Unigine::Texture::getImage with DX9 cause the following error: 22:20:40 Direct3D9 error: invalid call 22:20:40 D3D9Texture::getImage(): can't lock RGBA8 1000x800 2D texture Code snipped to reproduce: Unigine::TexturePtr texture; Unigine::ImagePtr image; texture = Unigine::Texture::create(); image = Unigine::Image::create(); // Create and set image if(!texture->create2D(_width, _height, Unigine::Texture::FORMAT_RGBA8)) // This works { Log::error( "Error while creating 2D texture!\n" ); } if(!texture->getImage(image)) // Error is thrown { Log::error( "Can't access image!\n" ); } The above code works well for DX11 and OpenGL. Thanks Manuel
frustum Posted March 21, 2014 Posted March 21, 2014 You should add managed flag during texture creation.
manuel.gysin Posted March 21, 2014 Author Posted March 21, 2014 Hello Frustum Added Texture::USAGE_MANAGED as flag but same error as before. Greets Manuel
manuel.gysin Posted March 21, 2014 Author Posted March 21, 2014 Thank you a lot, it's working now! :)
Recommended Posts