// This file is part of Desktop App Toolkit, // a set of libraries for developing nice desktop applications. // // For license and copyright information please follow this link: // https://github.com/desktop-app/legal/blob/master/LEGAL // #pragma once #include #include class OpenGLShaderProgram; namespace Ui::GL { struct ShaderPart { QString header; QString body; }; [[nodiscard]] QString VertexShader(const std::vector &parts); [[nodiscard]] QString FragmentShader(const std::vector &parts); [[nodiscard]] ShaderPart VertexPassTextureCoord(char prefix = 'v'); [[nodiscard]] ShaderPart FragmentSampleARGB32Texture(); [[nodiscard]] ShaderPart FragmentSampleYUV420Texture(); [[nodiscard]] ShaderPart FragmentSampleNV12Texture(); [[nodiscard]] ShaderPart FragmentGlobalOpacity(); [[nodiscard]] ShaderPart VertexViewportTransform(); [[nodiscard]] ShaderPart FragmentRoundCorners(); [[nodiscard]] ShaderPart FragmentStaticColor(); not_null MakeShader( not_null program, QOpenGLShader::ShaderType type, const QString &source); struct Program { not_null vertex; not_null fragment; }; Program LinkProgram( not_null program, std::variant> vertex, std::variant> fragment); } // namespace Ui::GL