Skip to content
Snippets Groups Projects
Commit 80a299ef authored by Sebastian Pape's avatar Sebastian Pape
Browse files

Fixed some bugs and added some comments

parent 448e0672
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@
#include "hmd_navigation_behavior.hpp"
#include "controller_overlay.hpp"
#include "ray_pass.hpp"
#include "screenshot_pass.hpp"
#include "selection_mark_handler.hpp"
#include "selector.hpp"
#include "turn_handler.hpp"
......@@ -342,6 +343,13 @@ void HMDNavigationBehavior::ButtonChange(
}
UpdateHelpers();
}
} else if (id == phx::VRController::ButtonId::k_EButton_ApplicationMenu &&
event == phx::VRController::ButtonEvent::BUTTON_PRESSED) {
engine_->GetSystem<phx::RenderingSystem>()
->GetFrameGraph()
->GetRenderPasses<phx::ScreenshotPass>()
.at(0)
->Screenshot();
}
}
......
......@@ -41,7 +41,7 @@ ScreenshotPass::~ScreenshotPass() { free(data_storage_); }
void ScreenshotPass::Initialize() {
dims_ = render_target_->GetDimensions();
data_storage_ = malloc(dims_.x * dims_.y * 3);
data_storage_ = malloc(dims_.x * dims_.y * 4);
}
void ScreenshotPass::Execute() {
......@@ -58,7 +58,7 @@ void ScreenshotPass::Execute() {
if (image->Save(name)) {
phx::info(("Saved " + name).c_str());
} else {
phx::info(("Could not save " + name).c_str());
phx::warn(("Could not save " + name).c_str());
}
delete image;
......
......@@ -28,7 +28,7 @@ layout (std140, binding = 0) uniform TextParams {
vec4 gradient1;
vec4 gradient2;
vec4 text_color;
vec2 string[100];
vec2 string[100]; //[char, rel_width]
uint num_chars;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment