finished prototype of nodes providing a texture to a viewer
This commit is contained in:
@@ -1,14 +1,45 @@
|
||||
#include "solid.h"
|
||||
|
||||
SolidGenerator::SolidGenerator(QObject *parent) :
|
||||
Node(parent)
|
||||
Node(parent),
|
||||
texture_(nullptr)
|
||||
{
|
||||
texture_output_ = new NodeOutput(this);
|
||||
texture_output_->set_data_type(NodeOutput::kTexture);
|
||||
}
|
||||
|
||||
QString SolidGenerator::Name()
|
||||
{
|
||||
return tr("Solid");
|
||||
}
|
||||
|
||||
QString SolidGenerator::Category()
|
||||
{
|
||||
return tr("Generator");
|
||||
}
|
||||
|
||||
QString SolidGenerator::Description()
|
||||
{
|
||||
return tr("Generate a solid color.");
|
||||
}
|
||||
|
||||
NodeOutput *SolidGenerator::texture_output()
|
||||
{
|
||||
return texture_output_;
|
||||
}
|
||||
|
||||
void SolidGenerator::Process(const rational &time)
|
||||
{
|
||||
Q_UNUSED(time)
|
||||
|
||||
// FIXME: Test code
|
||||
if (texture_ == nullptr) {
|
||||
QImage img(1920, 1080, QImage::Format_RGBA8888_Premultiplied);
|
||||
img.fill(Qt::red);
|
||||
|
||||
texture_ = new QOpenGLTexture(img);
|
||||
}
|
||||
|
||||
texture_output_->set_value(texture_->textureId());
|
||||
// End test code
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user