mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Fixed display cropped source in AppearanceView and code cleanup.
This commit is contained in:
@@ -212,11 +212,8 @@ void Mixer::update()
|
|||||||
transition_.update(dt_);
|
transition_.update(dt_);
|
||||||
|
|
||||||
// deep update was performed
|
// deep update was performed
|
||||||
if (View::need_deep_update_ > 0) {
|
if (View::need_deep_update_ > 0)
|
||||||
|
|
||||||
Log::Info("View::need_deep_update_ %d", View::need_deep_update_);
|
|
||||||
View::need_deep_update_--;
|
View::need_deep_update_--;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mixer::draw()
|
void Mixer::draw()
|
||||||
|
|||||||
@@ -171,21 +171,11 @@ void MediaSurface::accept(Visitor& v)
|
|||||||
v.visit(*this);
|
v.visit(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FrameBufferSurface::FrameBufferSurface(FrameBuffer *fb, Shader *s) : Surface(s), frame_buffer_(fb)
|
FrameBufferSurface::FrameBufferSurface(FrameBuffer *fb, Shader *s) : Surface(s), frame_buffer_(fb)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FrameBufferSurface::init()
|
|
||||||
{
|
|
||||||
Surface::init();
|
|
||||||
|
|
||||||
// set aspect ratio
|
|
||||||
// scale_.x = frame_buffer_->aspectRatio();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void FrameBufferSurface::draw(glm::mat4 modelview, glm::mat4 projection)
|
void FrameBufferSurface::draw(glm::mat4 modelview, glm::mat4 projection)
|
||||||
{
|
{
|
||||||
if ( !initialized() )
|
if ( !initialized() )
|
||||||
@@ -204,7 +194,6 @@ void FrameBufferSurface::accept(Visitor& v)
|
|||||||
v.visit(*this);
|
v.visit(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Points::Points(std::vector<glm::vec3> points, glm::vec4 color, uint pointsize) : Primitive(new Shader)
|
Points::Points(std::vector<glm::vec3> points, glm::vec4 color, uint pointsize) : Primitive(new Shader)
|
||||||
{
|
{
|
||||||
for(size_t i = 0; i < points.size(); ++i)
|
for(size_t i = 0; i < points.size(); ++i)
|
||||||
@@ -218,8 +207,6 @@ Points::Points(std::vector<glm::vec3> points, glm::vec4 color, uint pointsize) :
|
|||||||
pointsize_ = pointsize;
|
pointsize_ = pointsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Points::draw(glm::mat4 modelview, glm::mat4 projection)
|
void Points::draw(glm::mat4 modelview, glm::mat4 projection)
|
||||||
{
|
{
|
||||||
if ( !initialized() )
|
if ( !initialized() )
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ class FrameBufferSurface : public Surface {
|
|||||||
public:
|
public:
|
||||||
FrameBufferSurface(FrameBuffer *fb, Shader *s = new ImageShader);
|
FrameBufferSurface(FrameBuffer *fb, Shader *s = new ImageShader);
|
||||||
|
|
||||||
void init () override;
|
|
||||||
void draw (glm::mat4 modelview, glm::mat4 projection) override;
|
void draw (glm::mat4 modelview, glm::mat4 projection) override;
|
||||||
void accept (Visitor& v) override;
|
void accept (Visitor& v) override;
|
||||||
|
|
||||||
|
|||||||
9
Source.h
9
Source.h
@@ -66,12 +66,6 @@ public:
|
|||||||
// tests if a given node is part of the source
|
// tests if a given node is part of the source
|
||||||
bool contains (Node *node) const;
|
bool contains (Node *node) const;
|
||||||
|
|
||||||
// a Source has a shader used to render in fbo
|
|
||||||
inline Shader *renderingShader () const { return renderingshader_; }
|
|
||||||
|
|
||||||
// a Source has a surface used to draw images
|
|
||||||
inline Surface *renderingSurface () const { return texturesurface_; }
|
|
||||||
|
|
||||||
// the rendering shader always have an image processing shader
|
// the rendering shader always have an image processing shader
|
||||||
inline ImageProcessingShader *processingShader () const { return processingshader_; }
|
inline ImageProcessingShader *processingShader () const { return processingshader_; }
|
||||||
|
|
||||||
@@ -83,6 +77,9 @@ public:
|
|||||||
// a Source has a shader to control mixing effects
|
// a Source has a shader to control mixing effects
|
||||||
inline ImageShader *blendingShader () const { return blendingshader_; }
|
inline ImageShader *blendingShader () const { return blendingshader_; }
|
||||||
|
|
||||||
|
// a Source has a shader used to render in fbo
|
||||||
|
inline Shader *renderingShader () const { return renderingshader_; }
|
||||||
|
|
||||||
// every Source has a frame buffer from the renderbuffer
|
// every Source has a frame buffer from the renderbuffer
|
||||||
virtual FrameBuffer *frame () const;
|
virtual FrameBuffer *frame () const;
|
||||||
|
|
||||||
|
|||||||
5
View.cpp
5
View.cpp
@@ -840,7 +840,8 @@ void showContextMenu(View::Mode m, const char* label)
|
|||||||
if (output) scale.x = output->aspectRatio() / s->frame()->aspectRatio();
|
if (output) scale.x = output->aspectRatio() / s->frame()->aspectRatio();
|
||||||
}
|
}
|
||||||
else if ( m == View::APPEARANCE ) {
|
else if ( m == View::APPEARANCE ) {
|
||||||
scale = s->renderingSurface()->scale_;
|
glm::vec2 crop = s->frame()->projectionArea();
|
||||||
|
scale = glm::vec3( crop, 1.f);
|
||||||
}
|
}
|
||||||
s->group(m)->scale_ = scale;
|
s->group(m)->scale_ = scale;
|
||||||
s->group(m)->rotation_.z = 0;
|
s->group(m)->rotation_.z = 0;
|
||||||
@@ -2118,7 +2119,7 @@ void AppearanceView::adjustBackground()
|
|||||||
// update rendering frame to match edit source AR
|
// update rendering frame to match edit source AR
|
||||||
image_original_width = edit_source_->frame()->aspectRatio();
|
image_original_width = edit_source_->frame()->aspectRatio();
|
||||||
surfacepreview->setTextureIndex( edit_source_->frame()->texture() );
|
surfacepreview->setTextureIndex( edit_source_->frame()->texture() );
|
||||||
// surfacepreview->scale_ = edit_source_->mixingsurface_->scale_;
|
surfacepreview->scale_ = edit_source_->mixingsurface_->scale_;
|
||||||
|
|
||||||
// surfacepreview->scale_.x = image_original_width;
|
// surfacepreview->scale_.x = image_original_width;
|
||||||
// image_crop_area.x *= image_original_width;
|
// image_crop_area.x *= image_original_width;
|
||||||
|
|||||||
Reference in New Issue
Block a user