Slick Forums

Discuss the Slick 2D Library
It is currently Tue Jun 18, 2013 9:08 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Feb 14, 2012 4:36 pm 
Offline
User avatar

Joined: Sun Jul 24, 2011 6:14 pm
Posts: 19
Hello,

I search to modify the contents of texture on the fly.

On this tread viewtopic.php?p=21196#p21196 ,Kappa talk about to fill the texture.
Someone can tell me how to get the buffer or the methode to modify the contents?
Is it possible to do that with Slick objet or should I change my texture object through GL?

Thanks a lot for your help.
Regards.
Axis.


Top
 Profile  
 
PostPosted: Tue Feb 14, 2012 4:57 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1477
In OpenGL this is called render-to-texture, in Slick we call it "image graphics". See here:
viewtopic.php?f=3&t=4537


Top
 Profile  
 
PostPosted: Tue Feb 14, 2012 7:58 pm 
Offline
User avatar

Joined: Sun Jul 24, 2011 6:14 pm
Posts: 19
Hello,

Thank davedes.
I read about on forum myImage.getGraphics() take a lot of time.
I want modify the texture directly to display video decoded by xuggler, i get a awt BufferedImage and i'd wish to transfer byte quickly.

Thanks
Regards.
Axis


Top
 Profile  
 
PostPosted: Tue Feb 14, 2012 11:20 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1477
Xuggler should decode the video into BGR24 format. Creating a BufferedImage is unecessary.

Since you are dealing with something that needs very high performance, you should avoid AWT and dive into OpenGL a little more:
  • Create a single video player texture that matches the pixel format Xuggler will be using
  • When a new video frame is decoded, get the RGB data from Xuggler
  • Update the video player texture with the new RGB data with glTexSubImage2D

Problem is, you can't ensure that glTexSubImage2D will place textures in memory at the exact necessary time. You might have more control over this with FBO/PBO.

This is beyond the scope of slick; and it is a fair bit of work if you don't know much about Xuggler or OpenGL. Good luck.


Top
 Profile  
 
PostPosted: Wed Feb 15, 2012 8:03 am 
Offline
User avatar

Joined: Sun Jul 24, 2011 6:14 pm
Posts: 19
Thanks davedes.
Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group