It is not possible to flip images using nk_image and nk_subimage
Hello, nk_subimage_id is casting the specified region components to nk_ushort which makes it impossible to use negative sizes on images. Using opengl, framebuffer textures have their origin on the bottom left, which requires me flip the y axis when rendering them in the ui, which is not possible currently. This seemed like an oversight to me, but if it is done on purpose, ignore me.
There is no set origin for textures. This is a common misconception about OpenGL just like the one about it using a right-handed coordinate system (spoiler it doesn't, your projection matrix flips it). For textures the origin is wherever the memory starts. If your image is stored right side up in memory the origin will be the top left of the image, if it's upside down it will be the bottom left.
In either case it is extremely easy to flip the image either in your UV coordinates that you pass in your buffers or in your shader by subtracting your texcoord.y (ie v) coordinate from 1.0. This doesn't require negative UVs at all, just flipping your axis. You could do it in either shader but more efficient to do in in your vertex shader. Just to verify that I'm not making this up, I just modified the shaders in programs 5.1 and 5.2 in LearnOpenGL and it works. Just changing a single line in there vertex screen shaders from this,
TexCoords = aTexCoords; to this TexCoords = vec2(aTexCoords.u, 1.0-aTexCoords.v); is the easiest way, but again you could change the actual UV coordinates in the arrays that you send to OpenGL.
That being said, using negative UVs for subimages might be possible once #466 is finished. I would certainly hope so as changing the nk_ushort region[4] to an nk_rect or nk_recti makes so much sense to me. Not sure why it is an array currently.