开发者

SDL_Surface in QWidget

开发者 https://www.devze.com 2023-04-12 23:14 出处:网络
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.

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".

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号