// qshaderprogram.sip generated by MetaSIP
//
// This file is part of the Qt3DRender Python extension module.
//
// Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
// 
// This file is part of PyQt6-3D.
// 
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file.  Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
// 
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license.  For more information contact
// info@riverbankcomputing.com.
// 
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.


namespace Qt3DRender
{
%TypeHeaderCode
#include <qshaderprogram.h>
%End

    class QShaderProgram : public Qt3DCore::QNode
    {
%TypeHeaderCode
#include <qshaderprogram.h>
%End

    public:
        explicit QShaderProgram(Qt3DCore::QNode *parent /TransferThis/ = 0);
        virtual ~QShaderProgram();

        enum ShaderType
        {
            Vertex,
            Fragment,
            TessellationControl,
            TessellationEvaluation,
            Geometry,
            Compute,
        };

        QByteArray vertexShaderCode() const;
        QByteArray tessellationControlShaderCode() const;
        QByteArray tessellationEvaluationShaderCode() const;
        QByteArray geometryShaderCode() const;
        QByteArray fragmentShaderCode() const;
        QByteArray computeShaderCode() const;
        void setShaderCode(Qt3DRender::QShaderProgram::ShaderType type, const QByteArray &shaderCode);
        QByteArray shaderCode(Qt3DRender::QShaderProgram::ShaderType type) const;
        static QByteArray loadSource(const QUrl &sourceUrl) /ReleaseGIL/;

    public slots:
        void setVertexShaderCode(const QByteArray &vertexShaderCode);
        void setTessellationControlShaderCode(const QByteArray &tessellationControlShaderCode);
        void setTessellationEvaluationShaderCode(const QByteArray &tessellationEvaluationShaderCode);
        void setGeometryShaderCode(const QByteArray &geometryShaderCode);
        void setFragmentShaderCode(const QByteArray &fragmentShaderCode);
        void setComputeShaderCode(const QByteArray &computeShaderCode);

    signals:
        void vertexShaderCodeChanged(const QByteArray &vertexShaderCode);
        void tessellationControlShaderCodeChanged(const QByteArray &tessellationControlShaderCode);
        void tessellationEvaluationShaderCodeChanged(const QByteArray &tessellationEvaluationShaderCode);
        void geometryShaderCodeChanged(const QByteArray &geometryShaderCode);
        void fragmentShaderCodeChanged(const QByteArray &fragmentShaderCode);
        void computeShaderCodeChanged(const QByteArray &computeShaderCode);

    public:
        enum Status
        {
            NotReady,
            Ready,
            Error,
        };

        QString log() const;
        Qt3DRender::QShaderProgram::Status status() const;

    signals:
        void logChanged(const QString &log);
        void statusChanged(Qt3DRender::QShaderProgram::Status status /ScopesStripped=2/);

    public:
        enum Format
        {
            GLSL,
            SPIRV,
        };

        void setFormat(Qt3DRender::QShaderProgram::Format format);
        Qt3DRender::QShaderProgram::Format format() const;

    signals:
        void formatChanged(Qt3DRender::QShaderProgram::Format format);
    };
};
