base setup for osx in place
This commit is contained in:
18
engine/texture.hpp
Normal file
18
engine/texture.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#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, GLint filter = GL_LINEAR, GLint wrap = GL_CLAMP_TO_EDGE);
|
||||
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);
|
||||
};
|
||||
Reference in New Issue
Block a user