Improved handling of invalid imagery in BufferObject

This commit is contained in:
Robert Osfield
2005-04-22 15:43:34 +00:00
parent af70cd8801
commit 2914f7c342
2 changed files with 15 additions and 7 deletions

View File

@@ -131,7 +131,6 @@ class OSG_EXPORT Image : public Object
*/
void copySubImage(int s_offset,int t_offset,int r_offset,osg::Image* source);
/** Width of image. */
inline int s() const { return _s; }
@@ -166,6 +165,9 @@ class OSG_EXPORT Image : public Object
/** Return the number of bytes the whole row/image/volume of pixels occupies, including all mip maps if included. */
unsigned int getTotalSizeInBytesIncludingMipmaps() const;
/** Return true if the Image represent a valid and usable imagery.*/
bool valid() const { return _s!=0 && _t!=0 && _r!=0 && _data!=0 && _dataType!=0; }
/** Raw image data. */
inline unsigned char *data() { return _data; }