diff options
Diffstat (limited to 'gfx/models/texture.cpp')
-rw-r--r-- | gfx/models/texture.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/gfx/models/texture.cpp b/gfx/models/texture.cpp index cd275e8..612f0a0 100644 --- a/gfx/models/texture.cpp +++ b/gfx/models/texture.cpp @@ -1,4 +1,6 @@ #include "texture.h"
+#include "glArrays.h"
+#include <GL/glew.h>
#include <cache.h>
#include <gfx/image.h>
#include <resource.h>
@@ -6,11 +8,10 @@ Cache<Texture> Texture::cachedTexture;
-Texture::Texture(const std::filesystem::path & fileName) : m_texture {}
+Texture::Texture(const std::filesystem::path & fileName)
{
const Image tex {Resource::mapPath(fileName).c_str(), STBI_rgb_alpha};
- glGenTextures(1, &m_texture);
glBindTexture(GL_TEXTURE_2D, m_texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
@@ -22,11 +23,6 @@ Texture::Texture(const std::filesystem::path & fileName) : m_texture {} GL_RGBA, GL_UNSIGNED_BYTE, tex.data.data());
}
-Texture::~Texture()
-{
- glDeleteTextures(1, &m_texture);
-}
-
void
Texture::Bind() const
{
|