diff --git a/src/gl/scene/gl_scene.cpp b/src/gl/scene/gl_scene.cpp index 08591283c..c2812db0f 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -480,7 +480,6 @@ void FGLRenderer::RenderTranslucent() // stencil, z-buffer and the projection matrix intact! // //----------------------------------------------------------------------------- -EXTERN_CVAR(Bool, gl_draw_sync) void FGLRenderer::DrawScene(int drawmode) { @@ -502,14 +501,6 @@ void FGLRenderer::DrawScene(int drawmode) } GLRenderer->mClipPortal = NULL; // this must be reset before any portal recursion takes place. - // Up to this point in the main draw call no rendering is performed so we can wait - // with swapping the render buffer until now. - if (!gl_draw_sync && drawmode == DM_MAINVIEW) - { - All.Unclock(); - static_cast(screen)->Swap(); - All.Clock(); - } RenderScene(recursion); // Handle all portals after rendering the opaque objects but before diff --git a/src/gl/scene/gl_walls.cpp b/src/gl/scene/gl_walls.cpp index 3afde063c..5b2271433 100644 --- a/src/gl/scene/gl_walls.cpp +++ b/src/gl/scene/gl_walls.cpp @@ -142,7 +142,6 @@ void GLWall::PutWall(bool translucent) { if (gl.lightmethod == LM_SOFTWARE && !translucent) { - // This is not yet ready. if (PutWallCompat(passflag[type])) return; } diff --git a/src/gl/system/gl_framebuffer.cpp b/src/gl/system/gl_framebuffer.cpp index ae1fabaed..ec77cfd14 100644 --- a/src/gl/system/gl_framebuffer.cpp +++ b/src/gl/system/gl_framebuffer.cpp @@ -179,9 +179,6 @@ void OpenGLFrameBuffer::InitializeState() // //========================================================================== -// Testing only for now. -CVAR(Bool, gl_draw_sync, true, 0) //false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) - void OpenGLFrameBuffer::Update() { if (!CanUpdate()) @@ -197,10 +194,7 @@ void OpenGLFrameBuffer::Update() GLRenderer->SetOutputViewport(nullptr); - if (gl_draw_sync || !swapped) - { - Swap(); - } + Swap(); swapped = false; Unlock(); CheckBench(); diff --git a/src/posix/cocoa/i_common.h b/src/posix/cocoa/i_common.h index 4a558cf24..9cedb0262 100644 --- a/src/posix/cocoa/i_common.h +++ b/src/posix/cocoa/i_common.h @@ -190,6 +190,9 @@ typedef NSInteger NSApplicationActivationPolicy; static const NSWindowCollectionBehavior NSWindowCollectionBehaviorFullScreenAuxiliary = NSWindowCollectionBehavior(1 << 8); +static const NSOpenGLPixelFormatAttribute NSOpenGLPFAOpenGLProfile(96); +static const NSOpenGLPixelFormatAttribute NSOpenGLProfileVersion3_2Core(0x3200); + #endif // prior to 10.7 #endif // COCOA_I_COMMON_INCLUDED diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index 945167ebf..c13f532dd 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -232,7 +232,7 @@ namespace class CocoaVideo : public IVideo { public: - explicit CocoaVideo(int multisample); + CocoaVideo(); virtual EDisplayType GetDisplayType() { return DISPLAY_Both; } virtual void SetWindowedScale(float scale); @@ -464,7 +464,7 @@ CocoaWindow* CreateCocoaWindow(const NSUInteger styleMask) // --------------------------------------------------------------------------- -CocoaVideo::CocoaVideo(const int multisample) +CocoaVideo::CocoaVideo() : m_window(CreateCocoaWindow(STYLE_MASK_WINDOWED)) , m_width(-1) , m_height(-1) @@ -491,13 +491,10 @@ CocoaVideo::CocoaVideo(const int multisample) attributes[i++] = NSOpenGLPFAAllowOfflineRenderers; } - if (multisample) + if (NSAppKitVersionNumber >= AppKit10_7) { - attributes[i++] = NSOpenGLPFAMultisample; - attributes[i++] = NSOpenGLPFASampleBuffers; - attributes[i++] = NSOpenGLPixelFormatAttribute(1); - attributes[i++] = NSOpenGLPFASamples; - attributes[i++] = NSOpenGLPixelFormatAttribute(multisample); + attributes[i++] = NSOpenGLPFAOpenGLProfile; + attributes[i++] = NSOpenGLProfileVersion3_2Core; } attributes[i] = NSOpenGLPixelFormatAttribute(0); @@ -1253,7 +1250,7 @@ void I_InitGraphics() val.Bool = !!Args->CheckParm("-devparm"); ticker.SetGenericRepDefault(val, CVAR_Bool); - Video = new CocoaVideo(0); + Video = new CocoaVideo; atterm(I_ShutdownGraphics); }