GL_Init: on OS X, enable multi-threaded OpenGL mode.

This moves some of the OpenGL implementation to a background thread, and makes draw calls block for a shorter amount of time. AFAIK, this is the default mode on most other OS'es, not sure why you have to explicitly ask for it on OS X.

N.B. the kCGLCEMPEngine constant is available on 10.4+ so I don't bother checking the OS X version.
More info: https://developer.apple.com/library/mac/technotes/tn2085/_index.html

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1137 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Eric Wasylishen 2014-11-02 23:01:20 +00:00
parent fce0215843
commit 2870be2bee

View file

@ -36,6 +36,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "SDL.h"
#endif
//ericw -- for putting the driver into multithreaded mode
#ifdef __APPLE__
#include <OpenGL/OpenGL.h>
#endif
#define MAX_MODE_LIST 600 //johnfitz -- was 30
#define MAX_BPPS_LIST 5
#define WARP_WIDTH 320
@ -1043,6 +1048,15 @@ static void GL_Init (void)
GL_CheckExtensions (); //johnfitz
#ifdef __APPLE__
// ericw -- enable multi-threaded OpenGL, gives a decent FPS boost.
// see: https://developer.apple.com/library/mac/technotes/tn2085/_index.html
if (kCGLNoError != CGLEnable( CGLGetCurrentContext(), kCGLCEMPEngine))
{
Con_Warning ("Couldn't enable multi-threaded OpenGL");
}
#endif
//johnfitz -- intel video workarounds from Baker
if (!strcmp(gl_vendor, "Intel"))
{