diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-01-01 16:44:19 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-01-01 16:44:19 +0000 |
commit | 7c03d93c367b842c464dca30e121bc4c20547c36 (patch) | |
tree | 6df340dc3b0bd16f6ced2a051a68fc8a3c67a08c /ui/icon.cpp | |
parent | First iteration with font/text support (diff) | |
download | ilt-7c03d93c367b842c464dca30e121bc4c20547c36.tar.bz2 ilt-7c03d93c367b842c464dca30e121bc4c20547c36.tar.xz ilt-7c03d93c367b842c464dca30e121bc4c20547c36.zip |
Generic solution for glGen/glDel arrays, then tidy-up the uses
Diffstat (limited to 'ui/icon.cpp')
-rw-r--r-- | ui/icon.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/ui/icon.cpp b/ui/icon.cpp index 371410a..657e953 100644 --- a/ui/icon.cpp +++ b/ui/icon.cpp @@ -1,4 +1,6 @@ #include "icon.h"
+#include "glArrays.h"
+#include <GL/glew.h>
#include <gfx/image.h>
#include <resource.h>
#include <stb/stb_image.h>
@@ -7,9 +9,8 @@ Icon::Icon(const std::filesystem::path & fileName) : Icon {Image {Resource::mapP {
}
-Icon::Icon(const Image & tex) : size {tex.width, tex.height}, m_texture {}
+Icon::Icon(const Image & tex) : size {tex.width, tex.height}
{
- glGenTextures(1, &m_texture);
glBindTexture(GL_TEXTURE_2D, m_texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
@@ -21,11 +22,6 @@ Icon::Icon(const Image & tex) : size {tex.width, tex.height}, m_texture {} GL_RGBA, GL_UNSIGNED_BYTE, tex.data.data());
}
-Icon::~Icon()
-{
- glDeleteTextures(1, &m_texture);
-}
-
void
Icon::Bind() const
{
|