create gs_texture from QPixmap/QImage

Lain

Forum Admin
Lain
Forum Moderator
Developer
Sorry for not responding, you'll probably have to manually map the data. I.E. get the memory data from the QPixmap or QImage and then upload it to the texture.
 

leyley

New Member
I have found that OBS has a Image File Helper to create texture from file. What I need, is a API that reads texture from memory (for me, QPixmap/QImage). Is there anyway to make this work?
 

leyley

New Member
Finally, I found the solution:
First, make a rgba array for QImage, the length of it must be 4 times of image width * image height.
Second, use gs_texture_create and gs_texture_set_image to create & set texture from rgba array above.
Then you can render the texture in the context!
 
Top