From b321d915d3eeaa8f36ab5834e7b25e1a866249f5 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Tue, 24 Jul 2018 23:59:52 +0200 Subject: [PATCH] Add a getter ofr retrieving a texture --- src/pixmap.cxx | 10 ++++++++++ src/pixmap.h | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/pixmap.cxx b/src/pixmap.cxx index a143abc..409d29f 100644 --- a/src/pixmap.cxx +++ b/src/pixmap.cxx @@ -455,6 +455,16 @@ CPixmap::Cache (size_t channel, SDL_Surface * surface, Point totalDim) return true; } +SDL_Texture * +CPixmap::getTexture (size_t channel) +{ + auto it = this->m_SDLTextureInfo.find (channel); + if (it == this->m_SDLTextureInfo.end ()) + return nullptr; + + return it->second.texture; +} + // Modifie la r�gion de clipping. void diff --git a/src/pixmap.h b/src/pixmap.h index edf17d8..a20408b 100644 --- a/src/pixmap.h +++ b/src/pixmap.h @@ -69,8 +69,9 @@ public: Point iconDim, Mode mode = FIX, size_t chBackWide = CHNONE); bool Cache (size_t channel, const std::string & pFilename, Point totalDim); bool Cache (size_t channel, SDL_Surface * surface, Point totalDim); - void SetClipping (Rect clip); - Rect GetClipping (); + SDL_Texture * getTexture (size_t channel); + void SetClipping (Rect clip); + Rect GetClipping (); bool IsIconPixel (size_t channel, Sint32 rank, Point pos);