How to load a texture from memory to use with image decorator ? #486
|
How to load a texture from memory to use with image decorator ? |
Replies: 3 comments 1 reply
|
You can do that by adding a load from memory mechanism yourself in your implementation of |
|
Thank you ! it works well, I'm using premade backend for win32 and gl2 so I haven't thought about this. |
|
here is another way, use SetFileInterface() to hook LoadTexture(Rml::Vector2i& texture_dimensions, const Rml::String& source). |
You can do that by adding a load from memory mechanism yourself in your implementation of
RenderInterface::LoadTexture(TextureHandle& texture_handle, Vector2i& texture_dimensions, const String& source).You just need to distinguish between the texture types by the
sourceparameter and then load the correct data.Not sure if it's the best way to do it, but it's what I did myself.