Skip to content
GitLab
Menu
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
77c3438b
Commit
77c3438b
authored
Mar 22, 2018
by
Martin Schultz
Browse files
fixes #13 by using a non multisampled FBO for picking
parent
3674f2d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
widgets/glWidget/QtBaseViewer.cc
View file @
77c3438b
...
...
@@ -1563,12 +1563,19 @@ void glViewer::contextMenuEvent(QGraphicsSceneContextMenuEvent* _e)
void
glViewer
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
_e
)
{
makeCurrent
();
QPoint
p
(
_e
->
scenePos
().
x
(),
_e
->
scenePos
().
y
());
QMouseEvent
me
(
QEvent
::
MouseButtonPress
,
p
,
_e
->
screenPos
(),
_e
->
button
(),
_e
->
buttons
(),
_e
->
modifiers
());
_e
->
accept
();
emit
signalMakeActive
();
const
GLuint
prevFBO
=
ACG
::
GLState
::
getFramebufferDraw
();
QFramebufferObject
*
nonMultisampledFBO
;
GLuint
fboHandle
;
int
samples
=
0
;
createQFBO
(
nonMultisampledFBO
,
&
fboHandle
,
glWidth
(),
glHeight
(),
&
samples
);
ACG
::
GLState
::
bindFramebuffer
(
GL_FRAMEBUFFER_EXT
,
fboHandle
);
glScene_
->
update
();
// right button pressed => popup menu (ignore here)
...
...
@@ -1608,6 +1615,10 @@ void glViewer::mousePressEvent(QGraphicsSceneMouseEvent* _e)
break
;
}
}
//restore old FBO
ACG
::
GLState
::
bindFramebuffer
(
GL_FRAMEBUFFER_EXT
,
prevFBO
);
//cleanup
deleteQFBO
(
nonMultisampledFBO
);
}
...
...
@@ -1894,7 +1905,7 @@ void glViewer::handleNormalNavigation( QMouseEvent* _event ) {
switch
(
_event
->
type
())
{
case
QEvent
::
MouseButtonPress
:
{
// Get the depth at the current mouse position ( projected )
// This is used to do the translation in world coordinates
// As the scene is rendered, we can get the depth directly from the framebuffer.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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