opengllibgdxbufferedimagexuggler

LibGDX: BufferedImage into Texture


I'm trying to play videos within a LibGDX application. I've managed to load the individual video frames sequentially into a java.awt.BufferedImage using Xuggler.

Now I'm stuck trying to get that into a LibGDX Texture. Anyone know a way to do this?

I managed to find these two LibGDX files that happen to use BufferedImage's, however can't see how to use this to get my data into a Texture :(


Solution

  • as soon as you transformed your bufferedImage to a pixmap just use the Texture constructor passing in a pixmap:

     Texture newTexture = new Texture(myPixmap);
    

    There are methods to construct an empty Pixmap and draw onto it. Use this pixmap then as described above