From e98fdea344f173c59b11549432b20114081a58b1 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 25 Jan 2024 23:19:03 +0000 Subject: Add traits helpers for glTexParameter functions --- ui/font.cpp | 11 +++++------ ui/icon.cpp | 10 +++++----- 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'ui') diff --git a/ui/font.cpp b/ui/font.cpp index ebd856d..305e0f3 100644 --- a/ui/font.cpp +++ b/ui/font.cpp @@ -4,10 +4,9 @@ #include #include #include FT_FREETYPE_H -#include "glArrays.h" +#include "gl_traits.h" #include #include -#include #include #include #include @@ -124,10 +123,10 @@ Font::getTextureWithSpace(unsigned int adv) const glBindTexture(GL_TEXTURE_2D, texture.texture); glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, static_cast(size.x), static_cast(size.y), 0, GL_RED, GL_UNSIGNED_BYTE, nullptr); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); return fontTextures.size() - 1; } diff --git a/ui/icon.cpp b/ui/icon.cpp index 38f4bf9..c3b5078 100644 --- a/ui/icon.cpp +++ b/ui/icon.cpp @@ -1,5 +1,5 @@ #include "icon.h" -#include "glArrays.h" +#include "gl_traits.h" #include #include #include @@ -13,11 +13,11 @@ Icon::Icon(const Image & tex) : size {tex.width, tex.height} { glBindTexture(GL_TEXTURE_2D, m_texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); + glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); + glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, static_cast(tex.width), static_cast(tex.height), 0, GL_RGBA, GL_UNSIGNED_BYTE, tex.data.data()); } -- cgit v1.2.3