Cocoa message loop? (vs. windows message loop)
While trying to port my game engine to mac, I stumble upon one basic (but big) problem. On windows, my main code looks like this (very simplified): PeekMessage(...) // check for windows messages switch (msg.message) { case WM_QUIT: ...; case WM_LBUTTONDOWN: ...; ... } TranslateMessage(&msg); DispatchMessage (&msg); for (std::vector<CMyBackgroundThread*>::iterator it = mythreads.begin(); it != mythreads.end(); ++it) { (*it)->processEvents(); } ... do other useful stuff like look if the window has resized and other stuff... drawFrame(); // draw a frame using opengl SwapBuffers(hDC); // swap