Commit 80a959a0 authored by Florian Oetke's avatar Florian Oetke
Browse files

added getter for virtual viewport

parent 1ade16bf
Pipeline #2326 passed with stage
in 4 minutes and 7 seconds
......@@ -26,10 +26,14 @@
#include <memory>
extern nk_size nk_do_progress(nk_flags *state,
struct nk_command_buffer *out, struct nk_rect bounds,
nk_size value, nk_size max, int modifiable,
const struct nk_style_progress *style, struct nk_input *in);
extern nk_size nk_do_progress(nk_flags* state,
struct nk_command_buffer* out,
struct nk_rect bounds,
nk_size value,
nk_size max,
int modifiable,
const struct nk_style_progress* style,
struct nk_input* in);
struct nk_context;
......@@ -106,7 +110,8 @@ namespace mirrage::gui {
auto ctx() -> nk_context*;
auto viewport() -> glm::vec4 {return _viewport;}
auto viewport() const noexcept { return _viewport; }
auto virtual_viewport() const noexcept -> glm::vec4;
void viewport(glm::vec4 new_viewport);
......
......@@ -461,6 +461,14 @@ namespace mirrage::gui {
_renderer = renderer;
}
auto Gui::virtual_viewport() const noexcept -> glm::vec4
{
if(_impl)
return {0.f, 0.f, _impl->screen_size.x, _impl->screen_size.y};
else
return _viewport;
}
void Gui::viewport(glm::vec4 new_viewport)
{
_viewport = new_viewport;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment