#pragma once
#include "Resource.h"
#include "Core/Graphics/Image.h"

namespace gui {

	class Texture : public Resource3D {
		STORM_CLASS;
	public:
		// Create a texture instance.
		STORM_CTOR Texture();
		STORM_CTOR Texture(Image *image);

		// Get the current image.
		Image *STORM_FN image();

		// Set the current image. Note, this causes the image to be uploaded to the texture again.
		// If you wish to render multiple textures on different passes, it is better to create
		// different `Texture` instances and assign them to the pipeline, rather than switching the
		// image in the same `Texture` object multiple times.
		void STORM_ASSIGN image(Image *newImage);

		// Sample the image. This member can be used in shaders to sample the texture.
		Color STORM_FN sample(Point coords);

		// TODO: Get/set sampler states as well.

	private:
		// The image.
		Image *imageRef;
	};
}
