#pragma once

#include "GLSLShader.h"
#include "Vector.h"

namespace Aftr
{

class GLSLShaderMipmapLevelViewer: public GLSLShader
{
public:
   static GLSLShaderMipmapLevelViewer* New( GLSLShaderDataShared* dataShared, float lodLevel, float texSizeXInPixels, float texSizeYInPixels );
   virtual ~GLSLShaderMipmapLevelViewer();

   GLSLShaderMipmapLevelViewer& operator =( const GLSLShaderMipmapLevelViewer& shader );

   /**
      Returns a copy of this instance. This is identical to invoking the copy constructor with
      the addition that this preserves the polymorphic type. That is, if this was a subclass
      of GLSLShader with additional members and methods, this will internally create the
      shader instance as that subclass, thereby preserving polymorphic behavior, members, and
      methods.

      This is in contrast with a copy constructor in the case where one performs:
      GLSLShader* myCopy = new GLSLShader( shaderToBeCopied );
      This will always create a GLSLShader* instance, not a subclass corresponding to the exact
      type of shaderToBeCopied.
   */
   virtual GLSLShader* getCopyOfThisInstance();

   void setLODLevel( float lodLevel ) { this->lodLevel = lodLevel; }

   virtual void bind() const override;
   virtual void unbind() const override;

protected:
   GLSLShaderMipmapLevelViewer( GLSLShaderDataShared* dataShared, float lodLevel, float texSizeXInPixels, float texSizeYInPixels );
   GLSLShaderMipmapLevelViewer( const GLSLShaderMipmapLevelViewer& toCopy );
   float lodLevel;
   Vector texSize;

};

} //namespace Aftr

