Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/147.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ iOS中的垂直同步(SDL2/OpenGL ES)_C++_Ios_Opengl Es_Sdl_Sdl 2 - Fatal编程技术网

C++ iOS中的垂直同步(SDL2/OpenGL ES)

C++ iOS中的垂直同步(SDL2/OpenGL ES),c++,ios,opengl-es,sdl,sdl-2,C++,Ios,Opengl Es,Sdl,Sdl 2,我正在使用iPhone模拟器(iOS 8.2),使用SDL2启用垂直同步时遇到问题 我想打电话: if (SDL_GL_SetSwapInterval(-1) == -1) if (SDL_GL_SetSwapInterval(1) == -1) std::cout << "Failed to set Vertical Sync" << std::endl; if(SDL\u GL\u SetSwapInterval(-1)=-1) 如果(SDL

我正在使用iPhone模拟器(iOS 8.2),使用SDL2启用垂直同步时遇到问题

我想打电话:

if (SDL_GL_SetSwapInterval(-1) == -1)
    if (SDL_GL_SetSwapInterval(1) == -1)
        std::cout << "Failed to set Vertical Sync" << std::endl;
if(SDL\u GL\u SetSwapInterval(-1)=-1)
如果(SDL_GL_SetSwapInterval(1)=-1)

std::cout此代码将FPS限制为
desiredFPS

while(!quit)
{
  frameStartTime = SDL_GetTicks();
  handleEvents();
  handleLogics();
  renderFrame();
  delayTime = (1000 / desiredFPS) - (SDL_GetTicks() - frameStartTime);
  SDL_Delay(delayTime);
}