From 1405d648b6264cfda7c46f5b251258335abaee83 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sat, 20 Aug 2022 11:56:05 -0400 Subject: transparency with font on ui box --- src/ui.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/ui.cpp') diff --git a/src/ui.cpp b/src/ui.cpp index a6c5081..71cb875 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -8,7 +8,7 @@ #include static NewRenderEvent NRE (0, 0, 0, 0); -static const unsigned int NRE_TEX_DATA = 0xFF0000FF; +static const unsigned int NRE_TEX_DATA = 0xBBBBBBBB; static std::basic_string buffer; void UISystem::configure(entityx::EntityManager&, entityx::EventManager&) @@ -28,7 +28,7 @@ void UISystem::update(entityx::EntityManager&, glGenTextures(1, &NRE.tex); glBindTexture(GL_TEXTURE_2D, NRE.tex); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, &NRE_TEX_DATA); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, &NRE_TEX_DATA); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); @@ -36,12 +36,12 @@ void UISystem::update(entityx::EntityManager&, glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - buffer += { 30, -50, -8, 0, 0, 1 }; - buffer += { 160, -50, -8, 0, 0, 1 }; - buffer += { 160, -10, -8, 0, 0, 1 }; - buffer += { 160, -10, -8, 0, 0, 1 }; - buffer += { 30, -10, -8, 0, 0, 1 }; - buffer += { 30, -50, -8, 0, 0, 1 }; + buffer += { 30, -50, -5, 0, 0, 1 }; + buffer += { 160, -50, -5, 0, 0, 1 }; + buffer += { 160, -10, -5, 0, 0, 1 }; + buffer += { 160, -10, -5, 0, 0, 1 }; + buffer += { 30, -10, -5, 0, 0, 1 }; + buffer += { 30, -50, -5, 0, 0, 1 }; glBindBuffer(GL_ARRAY_BUFFER, NRE.vbo); glBufferData(GL_ARRAY_BUFFER, -- cgit v1.2.3