From 248386861b75bb6c5dec0f6ed8589a957e5145dc Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 8 Dec 2009 17:25:45 +0000 Subject: [PATCH] From Sukender, "I experienced as some users before: I tried to rescale an image without a valid rendering context... And had problems to unserstand what the "GL_OUT_OF_MEMORY" meant! So I added a few comments for future users." --- include/osg/Image | 8 ++++++-- src/osg/Image.cpp | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/include/osg/Image b/include/osg/Image index 96094b50c..23bbcd681 100644 --- a/include/osg/Image +++ b/include/osg/Image @@ -135,10 +135,14 @@ class OSG_EXPORT Image : public BufferData virtual void readImageFromCurrentTexture(unsigned int contextID, bool copyMipMapsIfAvailable, GLenum type = GL_UNSIGNED_BYTE); - /** Scale image to specified size. */ + /** Scale image to specified size. + * \warning The method uses gluScaleImage() and thus needs a valid rendering context. + */ void scaleImage(int s,int t,int r) { scaleImage(s,t,r, getDataType()); } - /** Scale image to specified size and with specified data type. */ + /** Scale image to specified size and with specified data type. + * \warning The method uses gluScaleImage() and thus needs a valid rendering context. + */ virtual void scaleImage(int s,int t,int r, GLenum newDataType); /** Copy a source Image into a subpart of this Image at specified position. diff --git a/src/osg/Image.cpp b/src/osg/Image.cpp index 098389107..8bdc91124 100644 --- a/src/osg/Image.cpp +++ b/src/osg/Image.cpp @@ -960,9 +960,9 @@ void Image::scaleImage(int s,int t,int r, GLenum newDataType) } else { - delete [] newData; + delete [] newData; - notify(WARN) << "Error Image::scaleImage() did not succeed : errorString = "<