GPU: More work on OpenGL renderer

This commit is contained in:
Connor McLaughlin
2019-09-13 00:18:13 +10:00
parent 4706a906d5
commit aea7a18ac2
20 changed files with 655 additions and 412 deletions

24
src/common/gl_texture.h Normal file
View File

@ -0,0 +1,24 @@
#pragma once
#include "glad.h"
#include "types.h"
namespace GL {
class Texture
{
public:
Texture(u32 width, u32 height, GLenum format, GLenum type, const void* data = nullptr, bool linear_filter = false);
~Texture();
GLuint GetGLId() const { return m_id; }
u32 GetWidth() const { return m_width; }
u32 GetHeight() const { return m_height; }
void Bind();
private:
GLuint m_id;
u32 m_width;
u32 m_height;
};
} // namespace GL