Ticket #15536 (closed defect: fixed)
Always use HW accelerated OpenGL pixel format on OS X cocoa
|Reported by:||kristianduske||Owned by:||csomor|
|Keywords:||wxGLContext wxGLCanvas acceleration OpenGL osx cocoa mac||Cc:|
Currently, wxGLContext does not request a hardware accelerated pixel format on OS X cocoa. The result is that wxGLCanvas::IsDisplaySupported will report success for non-accelerated pixel formats, leading to slow performance if that pixel format is used to create the wxGLContext.
This is because the NSOpenGLPFAAccelerated attribute is missing from the attributes passed to NSOpenGLPixelFormat initWithAttributes. This differs from the behavior on msw, where an equivalent flag (WGL_FULL_ACCELERATION_ARB) is always passed to the wglChoosePixelFormatARB call. Therefore, the NSOpenGLPFAAccelerated should always be passed to the NSOpenGLPixelFormat initializer on OS X as well. The attached patch fixes this.