Updating texture in framelistener

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
balloyd1
Gnoblar
Posts: 16
Joined: Mon Sep 05, 2005 7:06 pm

Updating texture in framelistener

Post by balloyd1 » 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

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
				}
			}
		}
	}
}
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.

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();
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?
0 x

Post Reply