Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
362324d6
Commit
362324d6
authored
Mar 22, 2018
by
schultz
Browse files
applied changes from code review for MSAA fix
parent
93d9766a
Changes
3
Hide whitespace changes
Inline
Side-by-side
widgets/glWidget/QtBaseViewer.cc
View file @
362324d6
...
...
@@ -138,7 +138,7 @@ glViewer::glViewer( QGraphicsScene* _scene,
glDebugLogger_
(
0
),
#endif
pickCache_
(
0
),
mouseCache_
(
0
),
mouseCache_
(
nullptr
),
updatePickCache_
(
true
),
pickCacheSupported_
(
true
),
constrainedRotationAxis_
(
std
::
numeric_limits
<
double
>::
quiet_NaN
(),
0
,
0
),
...
...
@@ -1574,11 +1574,9 @@ void glViewer::mousePressEvent(QGraphicsSceneMouseEvent* _e)
emit
signalMakeActive
();
const
GLuint
prevFBO
=
ACG
::
GLState
::
getFramebufferDraw
();
static
unsigned
int
creationHeight
=
0
;
static
unsigned
int
creationWidth
=
0
;
static
GLuint
fboHandle
;
//recreate FBO if gl area was resized
if
(
mouseCache_
!=
nullptr
&&
(
glWidth
()
!=
creationWidth
||
glHeight
()
!=
creationHeight
))
if
(
mouseCache_
!=
nullptr
&&
QFBOResized
(
mouseCache_
))
{
deleteQFBO
(
mouseCache_
);
mouseCache_
=
nullptr
;
...
...
@@ -1586,13 +1584,13 @@ void glViewer::mousePressEvent(QGraphicsSceneMouseEvent* _e)
if
(
mouseCache_
==
nullptr
)
{
GLuint
fboHandle
;
int
samples
=
0
;
creationHeight
=
glHeight
();
creationWidth
=
glWidth
();
createQFBO
(
mouseCache_
,
&
fboHandle
,
creationWidth
,
creationHeight
,
&
samples
);
createQFBO
(
mouseCache_
,
&
fboHandle
,
glWidth
()
,
glHeight
(),
&
samples
);
}
ACG
::
GLState
::
bindFramebuffer
(
GL_FRAMEBUFFER_EXT
,
fboHandle
);
bindQFBO
(
mouseCache_
);
glScene_
->
update
();
// right button pressed => popup menu (ignore here)
...
...
widgets/glWidget/QtBaseViewer.hh
View file @
362324d6
...
...
@@ -573,6 +573,8 @@ private:
// wrapper to create QFramebufferObject returns true if QFBO is valid if samples is -1 the default samples are retrieved
bool
createQFBO
(
QOpenGLFramebufferObject
*&
_ptr
,
GLuint
*
_handle
,
int
_width
,
int
_height
,
int
*
_samples
);
bool
bindQFBO
(
QOpenGLFramebufferObject
*
_ptr
);
bool
QFBOResized
(
QOpenGLFramebufferObject
*
_ptr
);
void
blitQFBO
(
QOpenGLFramebufferObject
*
_ptr1
,
const
QRect
&
_size1
,
QOpenGLFramebufferObject
*
_ptr2
,
const
QRect
&
_size2
);
void
deleteQFBO
(
QOpenGLFramebufferObject
*
_ptr
);
...
...
widgets/glWidget/QtBaseViewer_qt.cc
View file @
362324d6
...
...
@@ -214,6 +214,20 @@ void glViewer::blitQFBO(QOpenGLFramebufferObject* _ptr1, const QRect& _size1, QO
//-----------------------------------------------------------------------------
bool
glViewer
::
bindQFBO
(
QOpenGLFramebufferObject
*
_ptr
)
{
return
_ptr
->
bind
();
}
//-----------------------------------------------------------------------------
bool
glViewer
::
QFBOResized
(
QOpenGLFramebufferObject
*
_ptr1
)
{
return
_ptr1
->
size
()
!=
QSize
(
glWidth
(),
glHeight
());
}
//-----------------------------------------------------------------------------
void
glViewer
::
deleteQFBO
(
QOpenGLFramebufferObject
*
_ptr
)
{
delete
_ptr
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment