0
我試圖讓SDL窗口出現,但似乎沒有工作。該程序將運行,並顯示窗口的功能將運行沒有錯誤,但沒有顯示在我的屏幕上。我在碼頭只有一個圖標,表示程序沒有響應。這裏是我的代碼:未出現SDL窗口
int main(int argc, const char * argv[]) {
MainComponent mainComponent;
mainComponent.init();
char myVar;
cout << "Enter any key to quit...";
cin >> myVar;
return 0;
}
void MainComponent::init() {
//Initialize SDL
SDL_Init(SDL_INIT_EVERYTHING);
window = SDL_CreateWindow("My Game Window", 100, 100, 100, 100, SDL_WINDOW_SHOWN);
cout << screenWidth << " " << screenHeight << endl;
if(window == nullptr) {
cout << "Error could not create window" << SDL_GetError() << endl;
}
SDL_Delay(5000);
}
這裏的圖標的屏幕截圖上了被告席https://www.dropbox.com/s/vc01iqp0z07zs25/Screenshot%202016-02-02%2017.26.44.png?dl=0 讓我知道如果有什麼我做錯了,謝謝!