Can you provide me with an example on how to load a texture with texImage2D (from OpenGL) and readImage (from the JuicyPixels library) in Haskell?
I know there is already a similar question here but cause I'm a newbie, I'm not been able to make that example works. I need the complete code and maybe also some explanation on how it works...
Sorry, I don't know how to operate with JuicyPixels, but I've done texture loading in OpenGL.
It is a bit more complex. It does loading textures from several files, assuming they are texture atlasses (contain several images on a texture).
You can examine what parts of this program specific to texture rendering (by cutting unnecessary parts) and figure out how to convert JuicePixels image to raw array of pixel colors (look into
bindBMPTexture
function in utils module)Good luck!