Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am trying to get my video to render to texture. The SDK example seems to only draw the scene when the video "creates" a new texture. However, I'm going to be using this texture in scenes where other objects are using regular textures, and everything will be running at higher framerates. When I tried to do that, my entire scene started flashing. I reduced the code to see if I could find the piece of code causing the problem, and got down to two lines:

 

Video video = Video.FromFile("test.avi");

video.RenderToTexture(D3DDevice);

 

 

If I comment out the 2nd line, everything works just fine. Adding it in seems to cause a problem. Like I said, the entire scene starts to flash. My guess would be that the video (being on a different thread) calls some event during my render loop and causes some kind of problem. . perhaps exiting out of the loop. Has anyone had this problem before, and if so, how has it been solved?

 

--Vic--

  • 2 months later...
Posted
i am having the same problem and i have been searching for a solution for it for a long time but i didnot find till now , :( if u knew how to fix it please post the code ok thanx
  • 5 years later...
Posted
The solution is to do the drawing, (the beginscene and endscene and device.draw...) within the TextureReadyToRender method or have your drawing method called within the TextureReadyToRender method.
  • 2 weeks later...
Posted

(doing this from my work pc) so i take it you mean

 

if Texturereadytorender do whatever...

 

if not do sod all, but won't that just do the same thing as its the extra thread thats halting the system, there is another way of doing it, if there's a way of getting the surface data or the date bytes/bits you can just paste to another layer.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...