rename .hpp headers to .h

This commit is contained in:
2017-01-31 22:48:55 +00:00
parent 4b26976d61
commit 39f44eca5e
19 changed files with 49 additions and 41 deletions

28
engine/texture.h Normal file
View File

@@ -0,0 +1,28 @@
#pragma once
class Texture2D
{
GLuint m_tex;
int m_width;
int m_height;
GLint m_format;
public:
bool create(int width, int height, GLint format = GL_RGBA, const uint8_t* data = nullptr);
bool create(const class Image& img);
bool load(std::string filename);
void destroy() { glDeleteTextures(1, &m_tex); }
void bind() const { glBindTexture(GL_TEXTURE_2D, m_tex); }
void unbind() const { glBindTexture(GL_TEXTURE_2D, 0); }
void update(const uint8_t* data);
};
class Sampler
{
GLuint id;
GLint current_unit;
public:
bool create(GLint filter = GL_LINEAR, GLint wrap = GL_CLAMP_TO_EDGE);
void set(GLint filter = GL_LINEAR, GLint wrap = GL_CLAMP_TO_EDGE);
void bind(int unit);
void unbind();
};