Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Glow
glow-extras
Commits
d67fd4bf
Commit
d67fd4bf
authored
Apr 03, 2020
by
Julius Nehring-Wirxel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved hacks to experimental header and namespace.
parent
95548646
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
+20
-12
viewer/glow-extras/viewer/experimental.hh
viewer/glow-extras/viewer/experimental.hh
+19
-0
viewer/glow-extras/viewer/view.hh
viewer/glow-extras/viewer/view.hh
+1
-12
No files found.
viewer/glow-extras/viewer/experimental.hh
0 → 100644
View file @
d67fd4bf
#pragma once
#include <glow-extras/viewer/view.hh>
namespace
glow
::
viewer
::
experimental
{
/// Query the 3D position at the given pixel, only usable in interactive viewers
inline
tg
::
optional
<
tg
::
pos3
>
interactive_get_position
(
int
x
,
int
y
)
{
return
detail
::
query_current_viewer_3d_position
(
x
,
y
);
}
/// Query the 3D position at the given pixel, only usable in interactive viewers
inline
tg
::
optional
<
tg
::
pos3
>
interactive_get_position
(
tg
::
pos2
const
pos
)
{
return
interactive_get_position
(
pos
.
x
,
pos
.
y
);
}
/// Get the window size, only usable in interactive viewers
inline
tg
::
isize2
interactive_get_window_size
()
{
return
detail
::
query_current_viewer_window_size
();
}
/// Get the last valid mouse postition, only usable in interactive viewers.
inline
tg
::
pos2
interactive_get_mouse_position
()
{
return
detail
::
query_mouse_position
();
}
}
viewer/glow-extras/viewer/view.hh
View file @
d67fd4bf
...
...
@@ -303,24 +303,13 @@ detail::raii_view_closer view_cleared(Args&&... args)
// Only functional inside ::interactive
inline
void
view_clear_accumulation
()
{
detail
::
submit_command
(
detail
::
command
::
sceneClearAccum
());
}
/// Query the 3D position at the given pixel, only usable in interactive viewers
inline
tg
::
optional
<
tg
::
pos3
>
interactive_get_position
(
int
x
,
int
y
)
{
return
detail
::
query_current_viewer_3d_position
(
x
,
y
);
}
/// Query the 3D position at the given pixel, only usable in interactive viewers
inline
tg
::
optional
<
tg
::
pos3
>
interactive_get_position
(
tg
::
pos2
const
pos
)
{
return
interactive_get_position
(
pos
.
x
,
pos
.
y
);
}
/// Get the window size, only usable in interactive viewers
inline
tg
::
isize2
interactive_get_window_size
()
{
return
detail
::
query_current_viewer_window_size
();
}
/// Get the last valid mouse postition, only usable in interactive viewers.
inline
tg
::
pos2
interactive_get_mouse_position
()
{
return
detail
::
query_mouse_position
();
}
/// Makes a screenshot of the current scene, only usable in interactive viewers
inline
void
make_screenshot
(
std
::
string
const
&
filename
,
int
w
=
-
1
,
int
h
=
-
1
,
int
accumulationCount
=
128
)
{
detail
::
make_screenshot
(
filename
,
w
,
h
,
accumulationCount
);
}
namespace
detail
{
/// Internal use only, returns all currently registered fonts, {name, path}
...
...
Write
Preview
Markdown
is supported
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