test code for getting texture from a node
This commit is contained in:
@@ -112,7 +112,8 @@ void NewSequenceDialog::accept() {
|
||||
s->set_audio_layout(AV_CH_LAYOUT_STEREO);
|
||||
|
||||
// FIXME: TEST CODE
|
||||
new NodeMedia(s.get());
|
||||
NodeMedia* m = new NodeMedia(s.get());
|
||||
s->texture_io = m->texture_output();
|
||||
// END TEST CODE
|
||||
|
||||
ComboAction* ca = new ComboAction();
|
||||
|
||||
+15
-3
@@ -150,8 +150,11 @@ long Sequence::GetEndFrame() {
|
||||
const QObjectList& all_tracks = children();
|
||||
|
||||
for (int i=0;i<all_tracks.size();i++) {
|
||||
Track* t = static_cast<Track*>(all_tracks.at(i));
|
||||
end_frame = qMax(t->GetEndFrame(), end_frame);
|
||||
Track* t = dynamic_cast<Track*>(all_tracks.at(i));
|
||||
|
||||
if (t != nullptr) {
|
||||
end_frame = qMax(t->GetEndFrame(), end_frame);
|
||||
}
|
||||
}
|
||||
|
||||
return end_frame;
|
||||
@@ -165,7 +168,11 @@ QVector<Clip *> Sequence::GetAllClips()
|
||||
|
||||
for (int j=0;j<tracks.size();j++) {
|
||||
|
||||
all_clips.append(static_cast<Track*>(tracks.at(j))->GetAllClips());
|
||||
Track* t = dynamic_cast<Track*>(tracks.at(j));
|
||||
|
||||
if (t != nullptr) {
|
||||
all_clips.append(t->GetAllClips());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -188,6 +195,11 @@ QVector<Track *> Sequence::GetTrackList(olive::TrackType type)
|
||||
return tracks;
|
||||
}
|
||||
|
||||
GLuint Sequence::texture()
|
||||
{
|
||||
return texture_io->GetValue().value<GLuint>();
|
||||
}
|
||||
|
||||
void Sequence::Close()
|
||||
{
|
||||
QVector<Clip*> all_clips = GetAllClips();
|
||||
|
||||
@@ -124,6 +124,11 @@ public:
|
||||
int TrackCount(olive::TrackType type);
|
||||
QVector<Track*> GetTrackList(olive::TrackType type);
|
||||
|
||||
// FIXME: TEST CODE
|
||||
GLuint texture();
|
||||
NodeIO* texture_io;
|
||||
// END TEST CODE
|
||||
|
||||
long playhead;
|
||||
|
||||
bool using_workarea;
|
||||
|
||||
@@ -723,6 +723,33 @@ void ViewerWidget::draw_gizmos() {
|
||||
}
|
||||
|
||||
void ViewerWidget::paintGL() {
|
||||
|
||||
if (viewer->seq != nullptr) {
|
||||
|
||||
QOpenGLFunctions* f = context()->functions();
|
||||
|
||||
makeCurrent();
|
||||
|
||||
// clear to solid black
|
||||
f->glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||
f->glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
|
||||
// draw texture from render thread
|
||||
|
||||
f->glViewport(0, 0, width(), height());
|
||||
|
||||
f->glBindTexture(GL_TEXTURE_2D, viewer->seq->texture());
|
||||
|
||||
qDebug() << "drawing texture" << viewer->seq->texture();
|
||||
|
||||
olive::rendering::Blit(pipeline_.get(), true, get_matrix());
|
||||
|
||||
f->glBindTexture(GL_TEXTURE_2D, 0);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
if (waveform) {
|
||||
draw_waveform_func();
|
||||
} else {
|
||||
@@ -771,4 +798,5 @@ void ViewerWidget::paintGL() {
|
||||
renderer.start_render(context(), viewer->seq.get(), viewer->get_playback_speed());
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user