Commit 30b2db11 authored by Robert Menzel's avatar Robert Menzel

added assert and more comments

parent b1f76d43
......@@ -91,6 +91,7 @@ public:
// ================================================================================================= SETTERS \/
// ========================================================================================================= \/
public:
//! _pData has to be created by new GLubyte[...] and will get deleted by this TextureData object!
void setData (GLubyte* _pData) { pData = _pData; }
void setWidth (GLsizei _width) { width = _width; }
void setHeight(GLsizei _height) { height = _height; }
......
......@@ -132,6 +132,7 @@ glm::vec4 TextureData::getTexel( glm::uvec2 _texCoord )
void TextureData::setTexel( glm::uvec2 _texCoord, glm::vec4 _color )
{
assert( pData && "can't set texels if there is no data store, define data using setData()" );
// clamp negative to 0:
_texCoord.x = std::max( 0u, _texCoord.x );
_texCoord.y = std::max( 0u, _texCoord.y );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment