colordialog/wheel/gradient: implemented basic UI components for color picking
This commit is contained in:
@@ -205,7 +205,7 @@ void OpenGLProxy::RunNodeAccelerated(const Node *node, const TimeRange &range, c
|
||||
vert_code = OpenGLShader::CodeDefaultVertex();
|
||||
}
|
||||
|
||||
shader = std::make_shared<OpenGLShader>();
|
||||
shader = OpenGLShader::Create();
|
||||
shader->create();
|
||||
shader->addShaderFromSourceCode(QOpenGLShader::Fragment, frag_code);
|
||||
shader->addShaderFromSourceCode(QOpenGLShader::Vertex, vert_code);
|
||||
|
||||
@@ -132,7 +132,13 @@ GLenum OpenGLRenderFunctions::GetPixelType(const PixelFormat::Format &format)
|
||||
return GL_INVALID_VALUE;
|
||||
}
|
||||
|
||||
void OpenGLRenderFunctions::Blit(OpenGLShaderPtr pipeline, bool flipped, QMatrix4x4 matrix) {
|
||||
void OpenGLRenderFunctions::Blit(OpenGLShaderPtr pipeline, bool flipped, QMatrix4x4 matrix)
|
||||
{
|
||||
Blit(pipeline.get(), flipped, matrix);
|
||||
}
|
||||
|
||||
void OpenGLRenderFunctions::Blit(OpenGLShader *pipeline, bool flipped, QMatrix4x4 matrix)
|
||||
{
|
||||
// FIXME: is currentContext() reliable here?
|
||||
QOpenGLFunctions* func = QOpenGLContext::currentContext()->functions();
|
||||
|
||||
@@ -181,7 +187,12 @@ void OpenGLRenderFunctions::Blit(OpenGLShaderPtr pipeline, bool flipped, QMatrix
|
||||
m_vao.destroy();
|
||||
}
|
||||
|
||||
void OpenGLRenderFunctions::OCIOBlit(OpenGLShaderPtr pipeline,
|
||||
void OpenGLRenderFunctions::OCIOBlit(OpenGLShaderPtr pipeline, GLuint lut, bool flipped, QMatrix4x4 matrix)
|
||||
{
|
||||
OCIOBlit(pipeline.get(), lut, flipped, matrix);
|
||||
}
|
||||
|
||||
void OpenGLRenderFunctions::OCIOBlit(OpenGLShader *pipeline,
|
||||
GLuint lut,
|
||||
bool flipped,
|
||||
QMatrix4x4 matrix)
|
||||
|
||||
@@ -46,8 +46,10 @@ public:
|
||||
* Transformation matrix to use when drawing (defaults to no transform)
|
||||
*/
|
||||
static void Blit(OpenGLShaderPtr pipeline, bool flipped = false, QMatrix4x4 matrix = QMatrix4x4());
|
||||
static void Blit(OpenGLShader* pipeline, bool flipped = false, QMatrix4x4 matrix = QMatrix4x4());
|
||||
|
||||
static void OCIOBlit(OpenGLShaderPtr pipeline, GLuint lut, bool flipped = false, QMatrix4x4 matrix = QMatrix4x4());
|
||||
static void OCIOBlit(OpenGLShader* pipeline, GLuint lut, bool flipped = false, QMatrix4x4 matrix = QMatrix4x4());
|
||||
|
||||
static void PrepareToDraw(QOpenGLFunctions* f);
|
||||
|
||||
|
||||
@@ -7,9 +7,14 @@ OpenGLShader::OpenGLShader()
|
||||
|
||||
}
|
||||
|
||||
OpenGLShaderPtr OpenGLShader::Create()
|
||||
{
|
||||
return std::make_shared<OpenGLShader>();
|
||||
}
|
||||
|
||||
OpenGLShaderPtr OpenGLShader::CreateDefault(const QString &function_name, const QString &shader_code)
|
||||
{
|
||||
OpenGLShaderPtr program = std::make_shared<OpenGLShader>();
|
||||
OpenGLShaderPtr program = Create();
|
||||
|
||||
// Add shaders to program
|
||||
program->addShaderFromSourceCode(QOpenGLShader::Vertex, CodeDefaultVertex());
|
||||
|
||||
@@ -17,6 +17,8 @@ class OpenGLShader : public QOpenGLShaderProgram {
|
||||
public:
|
||||
OpenGLShader();
|
||||
|
||||
static OpenGLShaderPtr Create();
|
||||
|
||||
static OpenGLShaderPtr CreateDefault(const QString &function_name = QString(),
|
||||
const QString &shader_code = QString());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user