mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
transparency management added
This commit is contained in:
@@ -10,7 +10,9 @@
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "renderer/images/texture.h"
|
||||
#include <core/graphics.h>
|
||||
#include <type_traits>
|
||||
|
||||
namespace mlx
|
||||
{
|
||||
@@ -44,7 +46,17 @@ namespace mlx
|
||||
|
||||
void GraphicsSupport::texturePut(Texture* texture, int x, int y)
|
||||
{
|
||||
_textures_to_render.emplace(texture, x, y);
|
||||
_textures_to_render.emplace_back(texture, x, y);
|
||||
std::size_t hash = std::hash<TextureRenderData>{}(_textures_to_render.back());
|
||||
_textures_to_render.back().hash = hash;
|
||||
|
||||
auto it = std::find_if(_textures_to_render.begin(), _textures_to_render.end() - 1, [=](const TextureRenderData& rhs)
|
||||
{
|
||||
return rhs.hash == hash;
|
||||
});
|
||||
|
||||
if(it != _textures_to_render.end() - 1)
|
||||
_textures_to_render.erase(it);
|
||||
}
|
||||
|
||||
void GraphicsSupport::loadFont(const std::filesystem::path& filepath, float scale)
|
||||
|
||||
Reference in New Issue
Block a user