/*Copyright (C) 2010-2012 Duncan Deveaux

This file is part of Hikou no mizu.

Hikou no mizu is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Hikou no mizu is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Hikou no mizu.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef DEF_TEXTURE
#define DEF_TEXTURE

#include "Graphics/GL.hpp"

#include <SDL/SDL_image.h>
#include <string>

class Texture
{
    public:
        Texture();
        ~Texture();
        
        void draw(float x1 = 0, float y1 = 0, float x2 = 1, float y2 = 1) const;
        
        //Get and set methods
        GLsizei getWidth() const;
        GLsizei getHeight() const;
        
        //Load methods
        void loadFromFile(const std::string &path);
        void loadFromMemory(const GLvoid *pixels, GLint format, GLenum dataFormat, GLsizei width, GLsizei height);
        
        //Static method
        static int nextPow2(int number);
    
    private:
        Texture(const Texture &copied);
        void operator=(const Texture &copied);
        
        GLuint m_glTexture;
        
        GLsizei m_width;
        GLsizei m_height;
};

#endif
