#ifndef PW_VISUAL_TEXTURE_HPP
#define PW_VISUAL_TEXTURE_HPP

#include <pw/core/globals.hpp>
#include <pw/core/image.hpp>
#include <pw/core/debug.hpp>

namespace pw {

class texture {
public:
	enum class data_type {
		color,
		normal
	};

	enum class data_layout {
		shape_1d,
		shape_2d,
		shape_3d
	};

	enum texture_dimension {
		dimension_s,
		dimension_t,
		dimension_r
	};

	enum wrap_mode {
		wrap_repeat,
		wrap_clamp,
		wrap_clamp_to_edge,
		wrap_clamp_to_repeat
	};

	texture();

	texture(shared_ptr<image> i,data_layout s,data_type = data_type::color);

	void set_image(shared_ptr<image> i);
	shared_ptr<image> get() const { return _image; }

	void set_type(data_type t);
	data_type type() const { return  _type; }

	void set_shape(data_layout s);
	data_layout shape() const { return _shape; }

	void set_wrap(wrap_mode w);
	wrap_mode wrap() const { return _wrap; }

	void generate_mipmaps();


	unsigned int native_handle() const;
	unsigned int native_sampler_handle() const;
protected:

	shared_ptr<image> _image;

	data_type _type;
	data_layout _shape;
	wrap_mode _wrap;

	struct impl;
	unique_ptr<impl> _impl;


};

}


#endif
