私はSDLとOpenGLを使用しており、SDL_SurfaceとSDL_SetVideoModeを作成します。
SDL_Init(SDL_INIT_EVERYTHING);
const SDL_VideoInfo * dinfo = SDL_GetVideoInfo();
// Setup the surface of SDL
if(configurer::fullscreened){
data::Wnd_Surface = SDL_SetVideoMode(configurer::window_width,configurer::window_height,dinfo->vfmt->BitsPerPixel,SDL_FULLSCREEN | SDL_OPENGL);
}else{
data::Wnd_Surface = SDL_SetVideoMode(configurer::window_width,configurer::window_height,16,SDL_OPENGL);
}
if(data::Wnd_Surface==0){
return -1;
}
SDL_WM_SetCaption("Test", "Test");
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
// Initialize GLEW
if(glewInit()!=0){
cout << "Failed to start glew";
return -1;
}
私はそれを私のメイン関数で初期化し、それから私は(メイン関数で)以下を持っています:
while(!data::terminate){
AscMainLoop();
SDL_Delay(80);
}
return 0;
すべてが順調です。私のAscMainLoop関数:
int timerelapse = SDL_GetTicks();
//Check for key events
/* BLA BLA BLA *(
AscUpdateComponents(); // Update matrixes and bla bla bla...
AscRender();// Paint
// Fps Counter Update
/* BLA BLA BLA */
SDL_GL_SwapBuffers();// Swap the buffers of our screen
問題が発生しています。アプリケーションを実行しましたが、画面に応答がありません。問題はメインのwhileループにあると思います。ウィンドウは開きますが、ドラッグしたりサイズを変更したりすることはできません。これは、ウィンドウの待機ステータス(Windows 7の面白い「待機してください」カーソルを使用)がアクティブになるようなものです。私はすでにメインループをスレッドに入れようとしました。何が起こっているのかわかりません...
編集:それはメイン機能でのループによって引き起こされたフリーズステータスのようなものです