#ifndef MAGNUM_ITEM_H
#define MAGNUM_ITEM_H

#include <Magnum/GL/Framebuffer.h>
#include <Magnum/Platform/GLContext.h>
#include "glclampf.h"
#include <QOpenGLFunctions>
#include <QtQuick/QQuickFramebufferObject>

// Forward declaring the renderer to avoid CMake's AUTOMOC
// to process Magnum's headers (where it fails)

class MagnumRenderer;

class MagnumItem : public QQuickFramebufferObject {
  Q_OBJECT
  Q_PROPERTY(qreal hue READ hue WRITE setHue NOTIFY hueChanged)
public:
  MagnumItem();
  Renderer *createRenderer() const override;

  inline qreal hue() const { return m_hue; }
  void setHue(qreal hue);

signals:
  void hueChanged();

private:
  void releaseResources() override;

  qreal m_hue;

  MagnumRenderer *m_renderer;
};

#endif // MAGNUM_ITEM_H
