forked from lokesh-sharma/GameEngine
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtexture.h
More file actions
37 lines (32 loc) · 1.06 KB
/
texture.h
File metadata and controls
37 lines (32 loc) · 1.06 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef TEXTURE_H
#define TEXTURE_H
#include <string>
#include <GL/glew.h>
class Texture
{
public:
Texture(const std::string& fileName , int numTextures=1, GLenum targetType = GL_TEXTURE_2D
, GLfloat filter = GL_LINEAR_MIPMAP_LINEAR ,GLenum internalFormat = GL_RGBA ,
GLenum format = GL_RGBA, bool clamp = false, GLenum attachment=GL_NONE);
Texture(unsigned char* data ,GLenum targetType,int width , int height , GLfloat filter ,GLenum internalFormat,
GLenum format , bool clamp , GLenum attach);
void Bind(GLuint id);
void bindAsRenderTarget() ;
void initTextures(unsigned char** data ,int width , int height , GLfloat* filters ,
GLenum* internalFormats , GLenum *formats, bool clamp );
void initRenderTargets(GLenum* attachments=0);
GLuint getTexture(int id) { return m_texture[id];}
virtual ~Texture();
protected:
private:
Texture(const Texture& texture) {}
void operator=(const Texture& texture) {}
GLuint* m_texture;
GLenum m_textureTarget ;
GLuint m_frameBuffer;
GLuint m_renderBuffer;
int m_height;
int m_width;
int m_numTextures;
};
#endif