このように定義されたファイルへのパスがあります:
const char* GROUND_TEXTURE_FILE = "objects/textures/grass.jpg";
そして、これが私が画像をロードするために使用する関数です:
bool loadTexImage2D(const string &fileName, GLenum target) {
...
// this will load image data to the currently bound image
// at first, we must convert fileName, for ascii, this method is fine?
wstring file(fileName.begin(), fileName.end());
if(ilLoadImage(file.c_str()) == IL_FALSE) { //here the program falls
私のコードで何が問題になっていますか? ilLoadImage
が呼び出されたときにプログラムが落ちるのはなぜですか? 私は、それはタイプfile.c_str()
としてうまくいくべきだと思いますwchar_t *
か?ご回答ありがとうございます :)