-
Notifications
You must be signed in to change notification settings - Fork 0
/
Texture.h
39 lines (35 loc) · 959 Bytes
/
Texture.h
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
38
39
#pragma once
#include <string>
#include <GL/glew.h>
#include "Types.h"
class Texture {
public:
Texture();
~Texture();
void bind() const;
void setMinFilter(GLint minFilter);
void setMagFilter(GLint magFilter);
void setWrapS(GLint wrapS);
void setWrapT(GLint wrapT);
void setBorderColour(float r, float g, float b, float a);
void loadBMP(const std::string& texFilePath, bool genMipmap = false);
void loadDDS(const std::string& texFilePath);
void loadRaw(const std::string& texFilePath, GLenum internalFormat, GLenum format, GLenum type, uint width, uint height, bool genMips);
GLuint getId() const { return m_texId; }
private:
GLuint m_texId;
GLint m_minFilter;
GLint m_magFilter;
GLint m_wrapS;
GLint m_wrapT;
};
class CubemapTexture {
public:
CubemapTexture();
~CubemapTexture();
void bind() const;
void loadDDS(const std::string& texFilePath, GLenum targetFace);
GLuint getId() const { return m_texId; }
private:
GLuint m_texId;
};