add ovr platform sdk and test photo sharing

This commit is contained in:
2019-06-02 23:28:27 +02:00
parent d8a1a99d04
commit 2d43b74956
10 changed files with 59 additions and 22 deletions

View File

@@ -9,6 +9,10 @@
#include "node_changelog.h"
#include "node_usermanual.h"
#ifdef __QUEST__
#include "oculus_vr.h"
#endif
std::shared_ptr<NodeProgressBar> App::show_progress(const std::string& title)
{
auto pb = std::make_shared<NodeProgressBar>();
@@ -426,13 +430,16 @@ void App::dialog_export(std::string ext)
if (canvas)
{
// TODO: use picker
canvas->m_canvas->export_equirectangular(work_path + "/" + doc_name + ext, [this]{
auto path = work_path + "/" + doc_name + ext;
canvas->m_canvas->export_equirectangular(path, [this, path]{
#if defined(__IOS__)
message_box("Export Equirectangular", "Image exported to Photos");
#elif defined(__OSX__)
message_box("Export Equirectangular", "Image exported to Pictures/PanoPainter folder");
#elif defined(_WIN32)
message_box("Export Equirectangular", "Image exported to " + work_path);
#elif defined(__QUEST__)
//auto result = ovr_Media_ShareToFacebook("Sharing from PanoPainter on Oculus Quest", path.c_str(), ovrMediaContentType_Photo);
#endif
});
}

View File

@@ -139,7 +139,7 @@ void App::vr_analog(const VRController& c, VRController::kButton b, VRController
void App::vr_digital(const VRController& c, VRController::kButton b, VRController::kAction a, glm::vec2 axis)
{
if (b == VRController::kButton::Pad && a == VRController::kAction::Press)
if (b == VRController::kButton::A && a == VRController::kAction::Press)
{
if (glm::length(axis) < 0.5f)
{
@@ -326,7 +326,9 @@ void App::vr_draw(const glm::mat4& proj, const glm::mat4& camera, const glm::mat
m_face_plane.draw_stroke();
}
glDisable(GL_DEPTH_TEST);
// draw the brush
/*
auto mode = dynamic_cast<CanvasModePen*>(canvas->m_canvas->modes[(int)canvas->m_canvas->m_current_mode][0]);
if (ui_visible && ui_inside && mode)
{
@@ -357,6 +359,7 @@ void App::vr_draw(const glm::mat4& proj, const glm::mat4& camera, const glm::mat
m_face_plane.draw_fill();
tex.unbind();
}
*/
// draw the 2D UI
if (ui_visible)
@@ -431,6 +434,7 @@ void App::vr_draw(const glm::mat4& proj, const glm::mat4& camera, const glm::mat
glm::mat4 ortho_proj(1);
/*
for (auto& mode : *canvas->m_canvas->m_mode)
mode->on_Draw(ortho_proj, proj, camera);
@@ -445,6 +449,7 @@ void App::vr_draw(const glm::mat4& proj, const glm::mat4& camera, const glm::mat
if (canvas->m_canvas->m_current_mode != kCanvasMode::Grid)
for (auto& mode : Canvas::modes[(int)kCanvasMode::Grid])
mode->on_Draw(ortho_proj, proj, camera);
*/
blend ? glEnable(GL_BLEND) : glDisable(GL_BLEND);
depth ? glEnable(GL_DEPTH_TEST) : glDisable(GL_DEPTH_TEST);