Kia.celever
Kia.celever

Reputation: 635

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 to convert my SDL_Surface into QPixmap. Anyone has any ideas?

Upvotes: 3

Views: 480

Answers (2)

gspr
gspr

Reputation: 11227

You might be interested in the SDL FAQ entry titled "Manually copy from non-window SDL_Surface to the GUI toolkit".

Upvotes: 1

Constantinius
Constantinius

Reputation: 35039

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.

Upvotes: 1

Related Questions