summaryrefslogtreecommitdiff
path: root/engine-ocean/Graphics/GLWrappers/texture.h
blob: 3ad2f1313af53dbe560ef0646953da9de2a7e1f8 (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
26
27
28
29
30
31
#pragma once

#include "GL/glew.h"
#include <string>

#include "glm/glm.hpp"

class Texture
{
public:
    Texture(int width, int height, GLenum texUnit = GL_TEXTURE0, GLint internalFormat = GL_RGBA, GLenum texTarget = GL_TEXTURE_2D);
    Texture(std::string filePath, GLenum texUnit = GL_TEXTURE0, GLint internalFormat = GL_RGBA, GLenum texTarget = GL_TEXTURE_2D);
    ~Texture();

    void bind();
    void bind(GLenum texUnit);
    void unbind();
    void unbind(GLenum texUnit);
    GLuint getHandle();
    GLuint getTexUnitUint();
    GLenum getTexUnitEnum();
    int getWidth();
    int getHeight();

private:
    GLuint m_handle;
    GLenum m_texUnit;
    GLenum m_texTarget;
    int m_width;
    int m_height;
};