如果我在 Raylib 中不使用线程加载纹理,它可以正常工作:
INFO: FILEIO: [assets/spades/5_spades.png] File loaded successfully
INFO: IMAGE: Data loaded successfully (112x176 | R8G8B8 | 1 mipmaps)
INFO: TEXTURE: [ID 46] Texture loaded successfully (112x176 | R8G8B8 | 1 mipmaps)
如果我调用该函数在线程内加载纹理,则会失败:
INFO: FILEIO: [assets/spades/7_spades.png] File loaded successfully
INFO: IMAGE: Data loaded successfully (112x176 | R8G8B8 | 1 mipmaps)
WARNING: TEXTURE: Failed to load texture
但它没有说明为什么加载纹理失败。
我已在此处发布了源代码: https: //github.com/imekon/RaylibThreading