Fixed vertical inversion of clones, rendering output, etc.

This commit is contained in:
brunoherbelin
2020-05-23 23:29:17 +02:00
parent 7ac223819b
commit ddace961ae
4 changed files with 9 additions and 6 deletions

View File

@@ -274,7 +274,7 @@ void ImGuiVisitor::visit (MediaSource& s)
} }
else { else {
ImGui::Text("Video File"); ImGui::Text("Video File");
if ( ImGui::Button("Open Media Player", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ) if ( ImGui::Button(IMGUI_TITLE_MEDIAPLAYER, ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
Settings::application.media_player = true; Settings::application.media_player = true;
} }
ImGuiToolkit::ButtonOpenUrl( SystemToolkit::path_filename(s.path()).c_str(), ImVec2(IMGUI_RIGHT_ALIGN, 0) ); ImGuiToolkit::ButtonOpenUrl( SystemToolkit::path_filename(s.path()).c_str(), ImVec2(IMGUI_RIGHT_ALIGN, 0) );
@@ -294,6 +294,8 @@ void ImGuiVisitor::visit (SessionSource& s)
void ImGuiVisitor::visit (RenderSource& s) void ImGuiVisitor::visit (RenderSource& s)
{ {
ImGui::Text("Rendering Output"); ImGui::Text("Rendering Output");
if ( ImGui::Button(IMGUI_TITLE_PREVIEW, ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
Settings::application.preview = true;
} }
void ImGuiVisitor::visit (CloneSource& s) void ImGuiVisitor::visit (CloneSource& s)

View File

@@ -141,7 +141,7 @@ void SessionSource::render()
session()->deleteSource(session()->failedSource()); session()->deleteSource(session()->failedSource());
// render the sesion into frame buffer // render the sesion into frame buffer
static glm::mat4 projection = glm::ortho(-1.f, 1.f, -1.f, 1.f, -1.f, 1.f); static glm::mat4 projection = glm::ortho(-1.f, 1.f, 1.f, -1.f, -1.f, 1.f);
renderbuffer_->begin(); renderbuffer_->begin();
sessionsurface_->draw(glm::identity<glm::mat4>(), projection); sessionsurface_->draw(glm::identity<glm::mat4>(), projection);
renderbuffer_->end(); renderbuffer_->end();
@@ -207,7 +207,7 @@ void RenderSource::render()
init(); init();
else { else {
// render the view into frame buffer // render the view into frame buffer
static glm::mat4 projection = glm::ortho(-1.f, 1.f, -1.f, 1.f, -1.f, 1.f); static glm::mat4 projection = glm::ortho(-1.f, 1.f, 1.f, -1.f, -1.f, 1.f);
renderbuffer_->begin(); renderbuffer_->begin();
sessionsurface_->draw(glm::identity<glm::mat4>(), projection); sessionsurface_->draw(glm::identity<glm::mat4>(), projection);
renderbuffer_->end(); renderbuffer_->end();

View File

@@ -635,7 +635,8 @@ void UserInterface::RenderPreview()
float width = ImGui::GetContentRegionAvail().x; float width = ImGui::GetContentRegionAvail().x;
ImVec2 imagesize ( width, width / ar); ImVec2 imagesize ( width, width / ar);
ImGui::Image((void*)(intptr_t)output->texture(), imagesize, ImVec2(0.f, 1.f), ImVec2(1.f, 0.f)); ImGui::Image((void*)(intptr_t)output->texture(), imagesize);
// ImGui::Image((void*)(intptr_t)output->texture(), imagesize, ImVec2(0.f, 1.f), ImVec2(1.f, 0.f));
ImGui::End(); ImGui::End();
} }

View File

@@ -206,7 +206,7 @@ void RenderView::setResolution(glm::vec3 resolution)
void RenderView::draw() void RenderView::draw()
{ {
static glm::mat4 projection = glm::ortho(-1.f, 1.f, -1.f, 1.f, -SCENE_DEPTH, 1.f); static glm::mat4 projection = glm::ortho(-1.f, 1.f, 1.f, -1.f, -SCENE_DEPTH, 1.f);
glm::mat4 P = glm::scale( projection, glm::vec3(1.f / frame_buffer_->aspectRatio(), 1.f, 1.f)); glm::mat4 P = glm::scale( projection, glm::vec3(1.f / frame_buffer_->aspectRatio(), 1.f, 1.f));
frame_buffer_->begin(); frame_buffer_->begin();
scene.root()->draw(glm::identity<glm::mat4>(), P); scene.root()->draw(glm::identity<glm::mat4>(), P);