Updating texture in framelistener
Posted: Wed Jan 20, 2016 7:44 am
I have some code that puts a material onto the screen. It displays where and how I expect when I use one of the project's reference materials.
However, when I use the new material for this location, defined as
I only get a black screen. The external texture source ogg_video is listening, and I can see data to be displayed.
It does start firing the frame listener, where the following code updates the texture created above.
I have already confirmed that videoData does have data (it is in X8R8G8B8 format), and the texture is set to that same format. Both buffers are the same size.
Does anyone know why it would stay a blank screen? Or have suggestions how to further isolate what is going wrong?
However, when I use the new material for this location, defined as
Code: Select all
material MainMenuVideo
{
technique
{
pass
{
lighting off
depth_write off
texture_unit
{
texture_source ogg_video
{
filename bzone.ogv
precache 16
play_mode loop
}
}
}
}
}
It does start firing the frame listener, where the following code updates the texture created above.
Code: Select all
unsigned char *texData=(unsigned char*) t->getBuffer()->lock(HardwareBuffer::HBL_DISCARD);
unsigned char *videoData=f->getBuffer();
memcpy(texData,videoData,w*h*4);
t->getBuffer()->unlock();
Does anyone know why it would stay a blank screen? Or have suggestions how to further isolate what is going wrong?