#ifndef QOPENGLBUFFERTHUMBNAIL_H
#define QOPENGLBUFFERTHUMBNAIL_H

#include "qopenglbufferbase.h"

namespace SOPENGL
{
    class QOpenGLBufferThumbnail : public QOpenGLBufferBase
    {
        Q_OBJECT
    public:
        explicit QOpenGLBufferThumbnail(QOpenGLContext* pContext, QSurfaceFormat surfaceformat, QObject *parent = 0);
        virtual ~QOpenGLBufferThumbnail();

        void ResetThumbnailTexture();

        virtual void initializeGL();

        void InitState();

        void CheckRegion(int nX, int nY);
        void CheckRegionSmall(int nX, int nY);

        virtual void Paint();
        virtual void PaintBuffer();



        void AddThumbnail(QString strFilenameThumbnail);

        void StartAnimation();


    signals:

    public slots:

    protected:
        QTime m_StartTime;
        QOpenGLBuffer m_VBOTest[8];



        QRect m_rectThumbnail[8];
        QRect m_rectThumbnailSmall[8];
        bool m_bThumbnailHover[8];

        QRect m_rectPrev;
        QRect m_rectNext;

        QRect m_rectPrevSmall;
        QRect m_rectNextSmall;

        QOpenGLBuffer m_VBOPrev;
        QOpenGLBuffer m_VBONext;

        QList<QOpenGLTexture*>* m_pThumbnailTextureList;
        QList<QString>* m_pThumbnailFileList;

        QOpenGLTextureButton* m_pButtonPrev;
        QOpenGLTextureButton* m_pButtonNext;
        QOpenGLTextureButton* m_pThumbnailHover;



        bool m_bPrevClicked;
        bool m_bNextClicked;

    };
}


#endif // QOPENGLBUFFERTHUMBNAIL_H
