Hi,
Would have posted this on the Slick forums, but tried to register and it threw up an error that it couldn’t connect to the mail server to send me the email. (actually wrote this yesterday but then JGO was unreachable - seems like everything I touch at the moment is breaking! :persecutioncomplex: )
I’ve just started experimenting with Slick. I’m thinking of using it as the starting point for a hardware accelerated video/image pipeline in my Praxis software. However, I’ve got a few questions I wondered if anyone on here could offer some advice on.
-
The current software pipeline uses premultiplied alpha for all transparent images. As I need to have this software pipeline available as a fallback, I’d like to use images with premultiplied alpha in Slick. This will make getting data in to (and occassionally out of) textures much easier. I’ve also read various things that suggest blending is more accurate using premultiplied alpha, particularly for blending between transparent surfaces. Has anyone done anything similar with Slick? I’m thinking I’ll need to subclass Image and create a wrapper to the Graphics that reimplements blend modes, color, etc. I wondered if there are any pointers or gotchas I should be aware of doing this?
-
The software pipeline has its data stored in int arrays as RGB or ARGB_PRE. I’m new to this OpenGL lark, so I wondered what people would advise as the best performing way to get this data into a texture? Currently for the ARGB data I’ve experimented with glTexSubImage2D, using a bytebuffer with little endian ordering, and pushing it up as BGRA. This was mentioned on the Slick forum somewhere, but I wondered if this is the best way to do it?
-
Am I right in thinking that textures on images need to be explicitly released, and they’re not just released when the Texture object is unused or GC’d? I was experimenting (rather naively) at first with setting a new texture to the image every frame, and it almost brought my computer to its knees. Adding a line to release the texture before setting the new one at least seemed to stop things falling over. However, there are various places in the Slick source code where the texture seems to be changed without releasing the old one. Am I missing something?
Thanks in advance for all and any help, Neil