Hi Jlnr !
Would it be possible for you to add a flag to the options, when we create a Gosu::Image, so that Gosu handles it as a single OpenGL Texture, and not optimized in a mixed 1024² texture ? Because if your current way is really good when we use the gl.tex.info left/right/top/bottom methods, it's not easy to specify :
- a portion that is different of one tile size
- to repeat a texture (impossible in fact, we have to add some geometry to handle it, or maybe I miss a way to do it).
For example, we're working with a woman on a map editor, and we have a spritesheet where we want to be able to pick a rectangular (not necessary square) selection of tiles, to handle it as a single 3D sprite. We provide to the user a pixel based selection, so for example we could take 24*16 based anywhere on the spritesheet, so we can't use Gosu::Image.load_tiles for that. We would rather go with Gosu::Image.new and want to specify a special portion of it to display a really specific quad. So we need to provide opengl with coordinates from 0.0 to 1.0, not from gl_tex_info.left to gl_tex_info.right, for example.
Using Gosu::Image#to_blob, I managed to recreate the texture, but it takes some time on launch, so maybe it would be a lot more efficient if Gosu could load it like this directly if asked on the options.
Loading...