SDL_Surface in QWidget
I want to use a SDL_Surface
inside a Qt window.
I created a SDL_Surface
using SDL_CreateRGBSurface()
.
I know how to display a QPixmap
in Qt window.
Now I only need开发者_JS百科 to convert my SDL_Surface
into QPixmap
.
Anyone has any ideas?
I have not yet worked on this particular problem, but my guess is, that you have to load the data from the SDL_Surface
into the QPixmap
with the according function. You could try it with loadFromData. Of course, you have to declare the correct pixel format. This information can be retrieved from the surface.
You might be interested in the SDL FAQ entry titled "Manually copy from non-window SDL_Surface to the GUI toolkit".
精彩评论