Hello I have a buffer in ARGB format. I am trying to bind it to a texture, sprite for display.
bitmap_in = sourceBuffer
ARGB buffer with width/height of sourceBufferRect
if (!Image.LoadFromPixels(bitmap_rect.width(),bitmap_rect.height(), bitmap_in))
{
// Error...
}
LoadFromPixels(w, h, PointerToPixelsInMemory);
Please note that when you load an image from memory, pixels must have a specific format, which is 32-bits RGBA.
I think I can bind them to opengl textures, but I don't regally want to do taht.
Is there a way in SF to load, translate the format?
anyone know of a good way, I am struggling to find much conversion information.
Edit: you know I'm sure you can do this at opengl level with parameters...maybe there is a way in SFML to just supply those parameters?
void glReadPixels( GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
GLvoid * data);
though not looked how loadpixel works. I assume it just sets a format?