我被困在这里上传纹理:
// The FileSystem::getPath(...) is part of the GitHub repository so we can find files on any IDE/platform; replace it with your own image path.
unsigned char *data = stbi_load(FileSystem::getPath("resources/textures/container.jpg").c_str(), &width, &height, &nrChannels, 0);关于上面的评论,我该如何用自己的形象路径来代替它呢?我试过这样的方法:
unsigned char *data = stbi_load("Desktop/container.jpg").c_str(), &width, &height, &nrChannels, 0);但是它没有起作用,当然,我的小脑袋现在已经负荷过重了,我只是不能正常思考。所以..。如何指定图像路径?
更新:这是我收到的错误消息:

发布于 2021-01-14 16:53:32
我找到了修复:正如约书亚所说,“将文件移到正确的项目目录中,这样相对路径才能工作”。因此,在我的项目中,我创建了一个名为“纹理”的文件夹,并在那里添加了纹理,并使用以下方法调用纹理:
unsigned char* data = stbi_load("Textures/container.jpg", &width, &height, &nrChannels, 0);我想通过添加约书亚的答案作为正确的答案来结束这篇文章,但是我想知道该如何做,所以我会添加这篇文章,以获得帮助和洞察力
https://stackoverflow.com/questions/65710667
复制相似问题