From ccc310d0452b7a5a5c1fb39ff327c4962bfbad38 Mon Sep 17 00:00:00 2001 From: zeljko Date: Mon, 6 Apr 2020 09:39:04 +0000 Subject: [PATCH] Qt5: glqtcontext fixed false about multisample support. Added Major & Minor version git-svn-id: trunk@62896 - --- components/opengl/glqtcontext.pas | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/components/opengl/glqtcontext.pas b/components/opengl/glqtcontext.pas index b1853549d1..4b613a1404 100644 --- a/components/opengl/glqtcontext.pas +++ b/components/opengl/glqtcontext.pas @@ -334,6 +334,13 @@ begin QWindow_setSurfaceType(QWidget_windowHandle(NewQtWidget.Widget), QSurfaceSurfaceTypeOpenGLSurface); AWinFormat := QSurfaceFormat_Create(); + + if MajorVersion > 0 then + begin + QSurfaceFormat_setMajorVersion(AWinFormat, MajorVersion); + QSurfaceFormat_setMinorVersion(AWinFormat, MinorVersion); + end; + if DoubleBuffered then QSurfaceFormat_setSwapBehavior(AWinFormat, QSurfaceSwapBehaviorDoubleBuffer); QSurfaceFormat_setSamples(AWinFormat, Integer(MultiSampling)); @@ -364,9 +371,11 @@ begin // AttrList.ContextFlags:=Attribs.ContextFlags or GLX_CONTEXT_DEBUG_BIT_ARB; if (MultiSampling > 1) and GLX_ARB_multisample(XDisplay,ScreenNum) then begin AttrList.MultiSampling := MultiSampling; - end else begin + end else + begin AttrList.MultiSampling:=0; - {$IFDEF UNIX}writeln('Multi-sampling not supported');{$ENDIF} + if MultiSampling > 1 then + {$IFDEF UNIX}writeln('Multi-sampling not supported');{$ENDIF} end; FBConfigsCount:=0; FBConfigs:=glXChooseFBConfig(XDisplay, ScreenNum, @AttrList.AttributeList[0], FBConfigsCount);