diff --git a/include/ACGL/OpenGL/Objects/Texture.hh b/include/ACGL/OpenGL/Objects/Texture.hh index 3838412aa36e3176f7094e025de266bb2788f410..99160a4a12538a90b8c85e124d882574460c511d 100644 --- a/include/ACGL/OpenGL/Objects/Texture.hh +++ b/include/ACGL/OpenGL/Objects/Texture.hh @@ -223,6 +223,27 @@ public: mType, _pData); } + + //! Set data for specific area within the texture + inline void setTexSubImage2D( + const GLvoid* _pData, + int _x, + int _y, + int _width, + int _height) + { + bind(); + glTexSubImage2D( + mTarget, + 0, + _x, + _y, + _width, + _height, + mFormat, + mType(), + _pData); + } //! Generate mipmaps from the current base texture (i.e. the texture from level 0). void generateMipmaps(void) const