8 개의 이미지를로드하려고합니다. 이 이미지는로드되지 않고 이유를 알지 못합니다. 내가 디렉토리에 파일을 배치 Xcode를 사용합니다. 내 코드에 문제가있을 수 있다고 생각합니다.SDL2 IMG_Load가 작동하지 않습니다.
기능 :
void loadImages() { for(int i = 0; i < 8; i++) pict[0] = NULL; pict[0] = IMG_Load("jpg/colorfull small jpg.jpg"); if(pict[0] == NULL) cout << "Unable to load image\n"; pict[1] = IMG_Load("jpg/colorfull big jpg.jpg"); if(pict[1] == NULL) cout << "Unable to load image\n"; pict[2] = IMG_Load("jpg/colorless small jpg.jpg"); if(pict[2] == NULL) cout << "Unable to load image\n"; pict[3] = IMG_Load("jpg/colorless big jpg.jpg"); if(pict[3] == NULL) cout << "Unable to load image\n"; pict[4] = IMG_Load("png/colorfull small png.png"); if(pict[4] == NULL) cout << "Unable to load image\n"; pict[5] = IMG_Load("png/colorfull big png.png"); if(pict[5] == NULL) cout << "Unable to load image\n"; pict[6] = IMG_Load("png/colorless small png.png"); if(pict[6] == NULL) cout << "Unable to load image\n"; pict[7] = IMG_Load("png/colorless big png.png"); if(pict[7] == NULL) cout << "Unable to load image\n"; }
컴파일러 :
디렉토리 :
IMG_GetError()는 무엇을 말합니까? – Xonar
"jpg/colorfull small jpg.jpg를 열 수 없습니다"그는 모두 8 명을 말합니다 – Sam