Skip to content
Snippets Groups Projects
Commit d67fd4bf authored by Julius Nehring-Wirxel's avatar Julius Nehring-Wirxel
Browse files

Moved hacks to experimental header and namespace.

parent 95548646
No related branches found
No related tags found
1 merge request!80Added getter for mouse-pos and windows size for interactive mode.
#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(); }
}
...@@ -303,24 +303,13 @@ detail::raii_view_closer view_cleared(Args&&... args) ...@@ -303,24 +303,13 @@ detail::raii_view_closer view_cleared(Args&&... args)
// Only functional inside ::interactive // Only functional inside ::interactive
inline void view_clear_accumulation() { detail::submit_command(detail::command::sceneClearAccum()); } 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 /// 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) inline void make_screenshot(std::string const& filename, int w = -1, int h = -1, int accumulationCount = 128)
{ {
detail::make_screenshot(filename, w, h, accumulationCount); detail::make_screenshot(filename, w, h, accumulationCount);
} }
namespace detail namespace detail
{ {
/// Internal use only, returns all currently registered fonts, {name, path} /// Internal use only, returns all currently registered fonts, {name, path}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment