summaryrefslogtreecommitdiff
path: root/texture.h
blob: e63feb2c3682b776244d64e7ae626a7ad2389819 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef _TEXTURE_H_
#define _TEXTURE_H_

#include "image.h"

class Texture {
	public:
		Texture();
		Texture(const Image& image);
		Texture(const std::string& filename);
		
		void load(const Image& image);
		
		void bind() const;
		unsigned int tex() const;
		unsigned int w() const;
		unsigned int h() const;
	protected:
		void build(const void* data, unsigned int format, unsigned int w, unsigned int h);
		unsigned int width;
		unsigned int height;
		unsigned int texture;
};

#endif // _TEXTURE_H_