QPixmap image loading problem

2019-05-19 05:47发布

Basically I am trying to load the image as a texture using QPixmap:

texture[T_WALL] = bindTexture(QPixmap(":/images/wall.png"), GL_TEXTURE_2D);

The code works on my development machine, but not in the vm / other pcs without QT. Initially I was using jpegs and just assumed that I messed up the plugins, but as I understand, no plugins are needed for png files so I have no idea where the problem is.

Results are the same when loading local files and using Qt resources.

I am deploying libgcc_s_dw2-1.ddl, mingwm10.dll, QtCore4.dll, QtGui4.dll, QtOpenGL4.dll. Do I need anything else?

标签: qt png qpixmap
1条回答
Evening l夕情丶
2楼-- · 2019-05-19 06:11

Try adding an imageformats directory to your application directory and put qmng4.dll there. See my answer to the question Qt dll deployment on windows If it still does not work, get the Sysinternals suite which contains dgbview.exe that allows you to watch qDebug messages (even for release builds).

查看更多
登录 后发表回答