hi
i have a buffer of an image that i get it from a camera. i want to display this image as a texture on a 3d plane. how can i convert this buffer that is an array of bytes to ITexture?
buffer to texture
Re: buffer to texture
i create an IImage pointer to my buffer.
i used following function to convert it to ITexture but it has access Violation error
video::ITexture* FacialMotionCapture::ImageTexture(video::IImage* image, core::stringc name)
{
video::ITexture* texture = m_Driver->addTexture(name.c_str(),image);
texture->grab(); //this line has access violation error
return texture;
}
i used following function to convert it to ITexture but it has access Violation error
video::ITexture* FacialMotionCapture::ImageTexture(video::IImage* image, core::stringc name)
{
video::ITexture* texture = m_Driver->addTexture(name.c_str(),image);
texture->grab(); //this line has access violation error
return texture;
}
Re: buffer to texture
If you want to display your camera stream I'd recommend a different approach.
1, Create an empty texture using this method
2, Whenever your cam buffer has new data available, call the texture's lock function to get access to the pixel data. Use write access to push the buffer data into the texture
3, Don't forget to unlock the texture and you're good to go
4, Such things rather belong to the beginners' forum
Cheers,
p.
1, Create an empty texture using this method
2, Whenever your cam buffer has new data available, call the texture's lock function to get access to the pixel data. Use write access to push the buffer data into the texture
3, Don't forget to unlock the texture and you're good to go
4, Such things rather belong to the beginners' forum
Cheers,
p.
beer->setMotivationCallback(this);