Changeset 10611
- Timestamp:
- 10/07/09 21:42:32 (4 years ago)
- Location:
- OpenSceneGraph/trunk
- Files:
-
- 15 modified
-
CMakeLists.txt (modified) (1 diff)
-
examples/CMakeLists.txt (modified) (3 diffs)
-
include/osg/GLU (modified) (1 diff)
-
include/osgUtil/SceneGraphBuilder (modified) (1 diff)
-
include/osgUtil/Tessellator (modified) (3 diffs)
-
src/osg/Config.in (modified) (1 diff)
-
src/osg/GLExtensions.cpp (modified) (1 diff)
-
src/osg/Image.cpp (modified) (1 diff)
-
src/osg/State.cpp (modified) (3 diffs)
-
src/osg/Texture.cpp (modified) (7 diffs)
-
src/osg/Texture1D.cpp (modified) (1 diff)
-
src/osgPlugins/CMakeLists.txt (modified) (1 diff)
-
src/osgText/Font.cpp (modified) (2 diffs)
-
src/osgUtil/RenderStage.cpp (modified) (1 diff)
-
src/osgUtil/Tessellator.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/CMakeLists.txt
r10450 r10611 280 280 281 281 OPTION(OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION "Set to ON to use the ref_ptr<> T* operator() output conversion. " ON) 282 283 OPTION(OSG_GLU_AVAILABLE "Set to OFF to disable use of OpenGL GLU library." ${OPENGL_GLU_FOUND}) 284 MARK_AS_ADVANCED(OSG_GLU_AVAILABLE) 282 285 283 286 ################################################################################ -
OpenSceneGraph/trunk/examples/CMakeLists.txt
r10585 r10611 72 72 ADD_SUBDIRECTORY(osgparticle) 73 73 ADD_SUBDIRECTORY(osgparticleeffects) 74 ADD_SUBDIRECTORY(osgphotoalbum)75 74 ADD_SUBDIRECTORY(osgpick) 76 75 ADD_SUBDIRECTORY(osgplanets) … … 104 103 ADD_SUBDIRECTORY(osgteapot) 105 104 ADD_SUBDIRECTORY(osgterrain) 106 ADD_SUBDIRECTORY(osgtessellate)107 105 ADD_SUBDIRECTORY(osgtext) 108 106 ADD_SUBDIRECTORY(osgtext3D) … … 141 139 ADD_SUBDIRECTORY(osgwidgetwindow) 142 140 141 IF(OSG_GLU_AVAILABLE) 142 ADD_SUBDIRECTORY(osgphotoalbum) 143 ADD_SUBDIRECTORY(osgtessellate) 144 ENDIF() 145 143 146 ADD_SUBDIRECTORY(osgpdf) 144 147 -
OpenSceneGraph/trunk/include/osg/GLU
r9882 r10611 15 15 #define OSG_GLU 1 16 16 17 #include <osg/ GL>17 #include <osg/Config> 18 18 19 #if defined(__APPLE__) || \ 20 (defined (_AIX) && !defined (_AIX51)) 21 #include <OpenGL/glu.h> 22 #else 23 #include <GL/glu.h> 24 #endif 19 #ifdef OSG_GLU_AVAILABLE 25 20 26 #if defined(GLU_TESS_CALLBACK_TRIPLEDOT) 27 typedef void (APIENTRY *GLU_TESS_CALLBACK)(...); 28 #else 29 typedef void (APIENTRY *GLU_TESS_CALLBACK)(); 21 #include <osg/GL> 22 23 #if defined(__APPLE__) || \ 24 (defined (_AIX) && !defined (_AIX51)) 25 #include <OpenGL/glu.h> 26 #else 27 #include <GL/glu.h> 28 #endif 29 30 #if defined(GLU_TESS_CALLBACK_TRIPLEDOT) 31 typedef void (APIENTRY *GLU_TESS_CALLBACK)(...); 32 #else 33 typedef void (APIENTRY *GLU_TESS_CALLBACK)(); 34 #endif 35 30 36 #endif 31 37 -
OpenSceneGraph/trunk/include/osgUtil/SceneGraphBuilder
r7942 r10611 23 23 24 24 namespace osgUtil { 25 26 #ifndef OSG_GLU_AVAILABLE 27 // as we have no GLU we'll just define the required enum values 28 #define GLU_FALSE 0 29 #define GLU_FILL 100012 30 #define GLU_SMOOTH 100000 31 #define GLU_OUTSIDE 100020 32 #define GLU_NONE 100002 33 #define GLU_POINT 100010 34 #define GLU_LINE 100011 35 #define GLU_FILL 100012 36 #define GLU_SILHOUETTE 100013 37 #endif 25 38 26 39 /** A class for assisting the building ascene graphs that is equivilant to OpenGL 1.0 style calls. -
OpenSceneGraph/trunk/include/osgUtil/Tessellator
r8649 r10611 43 43 44 44 /** The winding rule, see red book ch 11. */ 45 #ifdef OSG_GLU_AVAILABLE 45 46 enum WindingType{ 46 47 TESS_WINDING_ODD = GLU_TESS_WINDING_ODD, … … 50 51 TESS_WINDING_ABS_GEQ_TWO = GLU_TESS_WINDING_ABS_GEQ_TWO 51 52 } ; 52 53 #else 54 enum WindingType{ 55 TESS_WINDING_ODD, 56 TESS_WINDING_NONZERO, 57 TESS_WINDING_POSITIVE, 58 TESS_WINDING_NEGATIVE, 59 TESS_WINDING_ABS_GEQ_TWO 60 } ; 61 #endif 53 62 /** we interpret all contours in the geometry as a single set to be tessellated or 54 63 * each separate drawable's contours needs to be tessellated. */ … … 212 221 typedef std::vector<Vec3d*> Vec3dList; 213 222 223 #ifdef OSG_GLU_AVAILABLE 214 224 GLUtesselator* _tobj; 225 #else 226 void* _tobj; 227 #endif 215 228 PrimList _primList; 216 229 Vec3dList _coordData; -
OpenSceneGraph/trunk/src/osg/Config.in
r9235 r10611 31 31 #cmakedefine OSG_USE_UTF8_FILENAME 32 32 #cmakedefine OSG_DISABLE_MSVC_WARNINGS 33 33 #cmakedefine OSG_GLU_AVAILABLE 34 34 35 35 #endif -
OpenSceneGraph/trunk/src/osg/GLExtensions.cpp
r10528 r10611 236 236 } 237 237 238 239 bool osg::isGLUExtensionSupported(unsigned int contextID, const char *extension) 240 { 241 ExtensionSet& extensionSet = s_gluExtensionSetList[contextID]; 242 std::string& rendererString = s_gluRendererList[contextID]; 243 244 // if not already set up, initialize all the per graphic context values. 245 if (!s_gluInitializedList[contextID]) 246 { 247 s_gluInitializedList[contextID] = 1; 248 249 // set up the renderer 250 const GLubyte* renderer = glGetString(GL_RENDERER); 251 rendererString = renderer ? (const char*)renderer : ""; 252 253 // get the extension list from OpenGL. 254 const char* extensions = (const char*)gluGetString(GLU_EXTENSIONS); 255 if (extensions==NULL) return false; 256 257 // insert the ' ' delimiated extensions words into the extensionSet. 258 const char *startOfWord = extensions; 259 const char *endOfWord; 260 while ((endOfWord = strchr(startOfWord,' '))!=NULL) 238 #ifdef OSG_GLU_AVAILABLE 239 bool osg::isGLUExtensionSupported(unsigned int contextID, const char *extension) 240 { 241 ExtensionSet& extensionSet = s_gluExtensionSetList[contextID]; 242 std::string& rendererString = s_gluRendererList[contextID]; 243 244 // if not already set up, initialize all the per graphic context values. 245 if (!s_gluInitializedList[contextID]) 261 246 { 262 extensionSet.insert(std::string(startOfWord,endOfWord)); 263 startOfWord = endOfWord+1; 247 s_gluInitializedList[contextID] = 1; 248 249 // set up the renderer 250 const GLubyte* renderer = glGetString(GL_RENDERER); 251 rendererString = renderer ? (const char*)renderer : ""; 252 253 // get the extension list from OpenGL. 254 const char* extensions = (const char*)gluGetString(GLU_EXTENSIONS); 255 if (extensions==NULL) return false; 256 257 // insert the ' ' delimiated extensions words into the extensionSet. 258 const char *startOfWord = extensions; 259 const char *endOfWord; 260 while ((endOfWord = strchr(startOfWord,' '))!=NULL) 261 { 262 extensionSet.insert(std::string(startOfWord,endOfWord)); 263 startOfWord = endOfWord+1; 264 } 265 if (*startOfWord!=0) extensionSet.insert(std::string(startOfWord)); 266 267 osg::notify(INFO)<<"OpenGL extensions supported by installed OpenGL drivers are:"<<std::endl; 268 for(ExtensionSet::iterator itr=extensionSet.begin(); 269 itr!=extensionSet.end(); 270 ++itr) 271 { 272 osg::notify(INFO)<<" "<<*itr<<std::endl; 273 } 274 264 275 } 265 if (*startOfWord!=0) extensionSet.insert(std::string(startOfWord)); 266 267 osg::notify(INFO)<<"OpenGL extensions supported by installed OpenGL drivers are:"<<std::endl; 268 for(ExtensionSet::iterator itr=extensionSet.begin(); 269 itr!=extensionSet.end(); 270 ++itr) 271 { 272 osg::notify(INFO)<<" "<<*itr<<std::endl; 273 } 274 275 } 276 277 // true if extension found in extensionSet. 278 bool result = extensionSet.find(extension)!=extensionSet.end(); 279 280 if (result) osg::notify(INFO)<<"OpenGL utility library extension '"<<extension<<"' is supported."<<std::endl; 281 else osg::notify(INFO)<<"OpenGL utility library extension '"<<extension<<"' is not supported."<<std::endl; 282 283 return result; 284 } 276 277 // true if extension found in extensionSet. 278 bool result = extensionSet.find(extension)!=extensionSet.end(); 279 280 if (result) osg::notify(INFO)<<"OpenGL utility library extension '"<<extension<<"' is supported."<<std::endl; 281 else osg::notify(INFO)<<"OpenGL utility library extension '"<<extension<<"' is not supported."<<std::endl; 282 283 return result; 284 } 285 #else 286 bool osg::isGLUExtensionSupported(unsigned int, const char *) 287 { 288 return false; 289 } 290 #endif 291 292 285 293 286 294 #if defined(WIN32) -
OpenSceneGraph/trunk/src/osg/Image.cpp
r10600 r10611 876 876 } 877 877 878 879 void Image::scaleImage(int s,int t,int r, GLenum newDataType) 880 { 881 if (_s==s && _t==t && _r==r) return; 882 883 if (_data==NULL) 884 { 885 notify(WARN) << "Error Image::scaleImage() do not succeed : cannot scale NULL image."<<std::endl; 886 return; 887 } 888 889 if (_r!=1 || r!=1) 890 { 891 notify(WARN) << "Error Image::scaleImage() do not succeed : scaling of volumes not implemented."<<std::endl; 892 return; 893 } 894 895 896 897 unsigned int newTotalSize = computeRowWidthInBytes(s,_pixelFormat,newDataType,_packing)*t; 898 899 // need to sort out what size to really use... 900 unsigned char* newData = new unsigned char [newTotalSize]; 901 if (!newData) 902 { 903 // should we throw an exception??? Just return for time being. 904 notify(FATAL) << "Error Image::scaleImage() do not succeed : out of memory."<<newTotalSize<<std::endl; 905 return; 906 } 907 908 glPixelStorei(GL_PACK_ALIGNMENT,_packing); 909 glPixelStorei(GL_UNPACK_ALIGNMENT,_packing); 910 911 GLint status = gluScaleImage(_pixelFormat, 912 _s, 913 _t, 914 _dataType, 915 _data, 916 s, 917 t, 918 newDataType, 919 newData); 920 921 if (status==0) 922 { 923 924 // free old image. 925 _s = s; 926 _t = t; 927 _dataType = newDataType; 928 setData(newData,USE_NEW_DELETE); 929 } 930 else 931 { 932 delete [] newData; 933 934 notify(WARN) << "Error Image::scaleImage() did not succeed : errorString = "<<gluErrorString((GLenum)status)<<std::endl; 935 } 936 937 dirty(); 938 } 939 940 void Image::copySubImage(int s_offset, int t_offset, int r_offset, const osg::Image* source) 941 { 942 if (!source) return; 943 if (s_offset<0 || t_offset<0 || r_offset<0) 944 { 945 notify(WARN)<<"Warning: negative offsets passed to Image::copySubImage(..) not supported, operation ignored."<<std::endl; 946 return; 947 } 948 949 if (!_data) 950 { 951 notify(INFO)<<"allocating image"<<endl; 952 allocateImage(s_offset+source->s(),t_offset+source->t(),r_offset+source->r(), 953 source->getPixelFormat(),source->getDataType(), 954 source->getPacking()); 955 } 956 957 if (s_offset>=_s || t_offset>=_t || r_offset>=_r) 958 { 959 notify(WARN)<<"Warning: offsets passed to Image::copySubImage(..) outside destination image, operation ignored."<<std::endl; 960 return; 961 } 962 963 964 if (_pixelFormat != source->getPixelFormat()) 965 { 966 notify(WARN)<<"Warning: image with an incompatible pixel formats passed to Image::copySubImage(..), operation ignored."<<std::endl; 967 return; 968 } 969 970 void* data_destination = data(s_offset,t_offset,r_offset); 971 972 glPixelStorei(GL_PACK_ALIGNMENT,source->getPacking()); 973 glPixelStorei(GL_PACK_ROW_LENGTH,_s); 974 975 glPixelStorei(GL_UNPACK_ALIGNMENT,_packing); 976 977 GLint status = gluScaleImage(_pixelFormat, 978 source->s(), 979 source->t(), 980 source->getDataType(), 981 source->data(), 982 source->s(), 983 source->t(), 984 _dataType, 985 data_destination); 986 987 glPixelStorei(GL_PACK_ROW_LENGTH,0); 988 989 if (status!=0) 990 { 991 notify(WARN) << "Error Image::scaleImage() do not succeed : errorString = "<<gluErrorString((GLenum)status)<<std::endl; 992 } 993 994 } 995 878 #ifdef OSG_GLU_AVAILABLE 879 void Image::scaleImage(int s,int t,int r, GLenum newDataType) 880 { 881 if (_s==s && _t==t && _r==r) return; 882 883 if (_data==NULL) 884 { 885 notify(WARN) << "Error Image::scaleImage() do not succeed : cannot scale NULL image."<<std::endl; 886 return; 887 } 888 889 if (_r!=1 || r!=1) 890 { 891 notify(WARN) << "Error Image::scaleImage() do not succeed : scaling of volumes not implemented."<<std::endl; 892 return; 893 } 894 895 896 897 unsigned int newTotalSize = computeRowWidthInBytes(s,_pixelFormat,newDataType,_packing)*t; 898 899 // need to sort out what size to really use... 900 unsigned char* newData = new unsigned char [newTotalSize]; 901 if (!newData) 902 { 903 // should we throw an exception??? Just return for time being. 904 notify(FATAL) << "Error Image::scaleImage() do not succeed : out of memory."<<newTotalSize<<std::endl; 905 return; 906 } 907 908 glPixelStorei(GL_PACK_ALIGNMENT,_packing); 909 glPixelStorei(GL_UNPACK_ALIGNMENT,_packing); 910 911 GLint status = gluScaleImage(_pixelFormat, 912 _s, 913 _t, 914 _dataType, 915 _data, 916 s, 917 t, 918 newDataType, 919 newData); 920 921 if (status==0) 922 { 923 924 // free old image. 925 _s = s; 926 _t = t; 927 _dataType = newDataType; 928 setData(newData,USE_NEW_DELETE); 929 } 930 else 931 { 932 delete [] newData; 933 934 notify(WARN) << "Error Image::scaleImage() did not succeed : errorString = "<<gluErrorString((GLenum)status)<<std::endl; 935 } 936 937 dirty(); 938 } 939 #else 940 void Image::scaleImage(int,int,int, GLenum) 941 { 942 osg::notify(osg::NOTICE)<<"Warning: Image::scaleImage(int s,int t,int r, GLenum newDataType) not supported."<<std::endl; 943 } 944 #endif 945 946 #ifdef OSG_GLU_AVAILABLE 947 void Image::copySubImage(int s_offset, int t_offset, int r_offset, const osg::Image* source) 948 { 949 if (!source) return; 950 if (s_offset<0 || t_offset<0 || r_offset<0) 951 { 952 notify(WARN)<<"Warning: negative offsets passed to Image::copySubImage(..) not supported, operation ignored."<<std::endl; 953 return; 954 } 955 956 if (!_data) 957 { 958 notify(INFO)<<"allocating image"<<endl; 959 allocateImage(s_offset+source->s(),t_offset+source->t(),r_offset+source->r(), 960 source->getPixelFormat(),source->getDataType(), 961 source->getPacking()); 962 } 963 964 if (s_offset>=_s || t_offset>=_t || r_offset>=_r) 965 { 966 notify(WARN)<<"Warning: offsets passed to Image::copySubImage(..) outside destination image, operation ignored."<<std::endl; 967 return; 968 } 969 970 971 if (_pixelFormat != source->getPixelFormat()) 972 { 973 notify(WARN)<<"Warning: image with an incompatible pixel formats passed to Image::copySubImage(..), operation ignored."<<std::endl; 974 return; 975 } 976 977 void* data_destination = data(s_offset,t_offset,r_offset); 978 979 glPixelStorei(GL_PACK_ALIGNMENT,source->getPacking()); 980 glPixelStorei(GL_PACK_ROW_LENGTH,_s); 981 982 glPixelStorei(GL_UNPACK_ALIGNMENT,_packing); 983 984 GLint status = gluScaleImage(_pixelFormat, 985 source->s(), 986 source->t(), 987 source->getDataType(), 988 source->data(), 989 source->s(), 990 source->t(), 991 _dataType, 992 data_destination); 993 994 glPixelStorei(GL_PACK_ROW_LENGTH,0); 995 996 if (status!=0) 997 { 998 notify(WARN) << "Error Image::scaleImage() do not succeed : errorString = "<<gluErrorString((GLenum)status)<<std::endl; 999 } 1000 } 1001 #else 1002 void Image::copySubImage(int, int, int, const osg::Image*) 1003 { 1004 osg::notify(osg::NOTICE)<<"Warning: Image::copySubImage(int, int, int, const osg::Image*)) not supported."<<std::endl; 1005 } 1006 #endif 996 1007 997 1008 void Image::flipHorizontal() -
OpenSceneGraph/trunk/src/osg/State.cpp
r10601 r10611 983 983 if (errorNo!=GL_NO_ERROR) 984 984 { 985 #ifdef OSG_GLU_AVAILABLE 985 986 const char* error = (char*)gluErrorString(errorNo); 986 987 if (error) osg::notify(WARN)<<"Warning: detected OpenGL error '" << error<<"'"; 987 988 else osg::notify(WARN)<<"Warning: detected OpenGL error number 0x" << std::hex << errorNo << std::dec; 988 989 #else 990 osg::notify(WARN)<<"Warning: detected OpenGL error number 0x" << std::hex << errorNo << std::dec; 991 #endif 989 992 if (str) osg::notify(WARN)<<" at "<<str<< std::endl; 990 993 else osg::notify(WARN)<<" in osg::State."<< std::endl; … … 1000 1003 if (errorNo!=GL_NO_ERROR) 1001 1004 { 1005 #ifdef OSG_GLU_AVAILABLE 1002 1006 const char* error = (char*)gluErrorString(errorNo); 1003 1007 if (error) osg::notify(WARN)<<"Warning: detected OpenGL error '"<< error <<"' after applying GLMode 0x"<<hex<<mode<<dec<< std::endl; 1004 1008 else osg::notify(WARN)<<"Warning: detected OpenGL error number 0x"<< std::hex << errorNo <<" after applying GLMode 0x"<<hex<<mode<<dec<< std::endl; 1005 1009 #else 1010 osg::notify(WARN)<<"Warning: detected OpenGL error number 0x"<< std::hex << errorNo <<" after applying GLMode 0x"<<hex<<mode<<dec<< std::endl; 1011 #endif 1006 1012 return true; 1007 1013 } … … 1014 1020 if (errorNo!=GL_NO_ERROR) 1015 1021 { 1022 #ifdef OSG_GLU_AVAILABLE 1016 1023 const char* error = (char*)gluErrorString(errorNo); 1017 1024 if (error) osg::notify(WARN)<<"Warning: detected OpenGL error '"<< error <<"' after applying attribute "<<attribute->className()<<" "<<attribute<< std::endl; 1018 1025 else osg::notify(WARN)<<"Warning: detected OpenGL error number 0x"<< std::hex << errorNo <<" after applying attribute "<<attribute->className()<<" "<<attribute<< std::dec << std::endl; 1026 #else 1027 osg::notify(WARN)<<"Warning: detected OpenGL error number 0x"<< std::hex << errorNo <<" after applying attribute "<<attribute->className()<<" "<<attribute<< std::dec << std::endl; 1028 #endif 1019 1029 1020 1030 return true; -
OpenSceneGraph/trunk/src/osg/Texture.cpp
r10610 r10611 1748 1748 if (needImageRescale) 1749 1749 { 1750 1750 #ifdef OSG_GLU_AVAILABLE 1751 1751 // resize the image to power of two. 1752 1752 … … 1779 1779 image->s(),image->t(),image->getDataType(),image->data(), 1780 1780 inwidth,inheight,image->getDataType(),dataPtr); 1781 1782 } 1781 #else 1782 osg::notify(osg::NOTICE)<<"Warning: gluScaleImage(..) not supported, cannot subload image."<<std::endl; 1783 return; 1784 #endif 1785 } 1783 1786 1784 1787 bool mipmappingRequired = _min_filter != LINEAR && _min_filter != NEAREST; … … 1892 1895 { 1893 1896 numMipmapLevels = 0; 1894 1897 #ifdef OSG_GLU_AVAILABLE 1895 1898 gluBuild2DMipmaps( target, _internalFormat, 1896 1899 inwidth,inheight, … … 1905 1908 height >>= 1; 1906 1909 } 1910 #else 1911 osg::notify(osg::NOTICE)<<"Warning:: gluBuild2DMipMaps(..) not supported."<<std::endl; 1912 #endif 1907 1913 } 1908 1914 else … … 1990 1996 if (needImageRescale) 1991 1997 { 1992 1998 #ifdef OSG_GLU_AVAILABLE 1993 1999 // resize the image to power of two. 1994 1995 2000 if (image->isMipmap()) 1996 2001 { … … 2003 2008 return; 2004 2009 } 2005 2010 2006 2011 unsigned int newTotalSize = osg::Image::computeRowWidthInBytes(inwidth,image->getPixelFormat(),image->getDataType(),image->getPacking())*inheight; 2007 2012 data = new unsigned char [newTotalSize]; 2008 2013 2009 2014 if (!data) 2010 2015 { … … 2021 2026 image->s(),image->t(),image->getDataType(),image->data(), 2022 2027 inwidth,inheight,image->getDataType(),data); 2028 #else 2029 osg::notify(osg::NOTICE)<<"Warning: gluScaleImage(..) not supported, cannot subload image."<<std::endl; 2030 return; 2031 #endif 2023 2032 } 2024 2033 -
OpenSceneGraph/trunk/src/osg/Texture1D.cpp
r10606 r10611 300 300 numMipmapLevels = 1; 301 301 302 #ifdef OSG_GLU_AVAILABLE 302 303 gluBuild1DMipmaps( target, _internalFormat, 303 304 image->s(), 304 305 (GLenum)image->getPixelFormat(), (GLenum)image->getDataType(), 305 306 image->data() ); 307 #else 308 osg::notify(osg::NOTICE)<<"Warning: gluBuild1DMipmaps(..) not supported."<<std::endl; 309 #endif 306 310 307 311 } -
OpenSceneGraph/trunk/src/osgPlugins/CMakeLists.txt
r10293 r10611 158 158 ENDIF() 159 159 160 ADD_SUBDIRECTORY(lwo) 160 IF(OSG_GLU_AVAILABLE) 161 ADD_SUBDIRECTORY(lwo) 162 ADD_SUBDIRECTORY(dw) 163 ENDIF() 164 161 165 ADD_SUBDIRECTORY(bvh) 162 166 ADD_SUBDIRECTORY(x) 163 ADD_SUBDIRECTORY(dw)164 167 ADD_SUBDIRECTORY(ply) 165 168 ADD_SUBDIRECTORY(dxf) -
OpenSceneGraph/trunk/src/osgText/Font.cpp
r10588 r10611 861 861 if (errorNo!=GL_NO_ERROR) 862 862 { 863 osg::notify(osg::WARN)<<"before Font::Glyph::subload(): detected OpenGL error '"<<gluErrorString(errorNo)<<std::endl; 863 #ifdef OSG_GLU_AVAILABLE 864 const GLubyte* msg = gluErrorString(errorNo); 865 if (msg) osg::notify(osg::WARN)<<"before Font::Glyph::subload(): detected OpenGL error: "<<msg<<std::endl; 866 else osg::notify(osg::WARN)<<"before Font::Glyph::subload(): detected OpenGL error number: "<<errorNo<<std::endl; 867 #else 868 osg::notify(osg::WARN)<<"before Font::Glyph::subload(): detected OpenGL error number: "<<errorNo<<std::endl; 869 #endif 864 870 } 865 871 … … 883 889 { 884 890 885 osg::notify(osg::WARN)<<"after Font::Glyph::subload() : detected OpenGL error '"<<gluErrorString(errorNo)<<"'"<<std::endl; 891 892 #ifdef OSG_GLU_AVAILABLE 893 const GLubyte* msg = gluErrorString(errorNo); 894 if (msg) osg::notify(osg::WARN)<<"after Font::Glyph::subload() : detected OpenGL error: "<<msg<<std::endl; 895 else osg::notify(osg::WARN)<<"after Font::Glyph::subload() : detected OpenGL error number: "<<errorNo<<std::endl; 896 #else 897 osg::notify(osg::WARN)<<"after Font::Glyph::subload() : detected OpenGL error number: "<<errorNo<<std::endl; 898 #endif 899 886 900 osg::notify(osg::WARN)<< "\tglTexSubImage2D(0x"<<hex<<GL_TEXTURE_2D<<dec<<" ,"<<0<<"\t"<<std::endl<< 887 901 "\t "<<_texturePosX<<" ,"<<_texturePosY<<std::endl<< -
OpenSceneGraph/trunk/src/osgUtil/RenderStage.cpp
r10547 r10611 882 882 if (errorNo!=GL_NO_ERROR) 883 883 { 884 #ifdef OSG_GLU_AVAILABLE 884 885 const char* error = (char*)gluErrorString(errorNo); 885 886 if (error) osg::notify(osg::NOTICE)<<"Warning: detected OpenGL error '"<<error<<"' after RenderBin::draw(,)"<<std::endl; 886 887 else osg::notify(osg::NOTICE)<<"Warning: detected OpenGL errorNo= 0x"<<std::hex<<errorNo<<" after RenderBin::draw(,)"<<std::dec<<std::endl; 887 888 #else 889 osg::notify(osg::NOTICE)<<"Warning: detected OpenGL errorNo= 0x"<<std::hex<<errorNo<<" after RenderBin::draw(,)"<<std::dec<<std::endl; 890 #endif 888 891 if ( fbo_ext ) 889 892 { -
OpenSceneGraph/trunk/src/osgUtil/Tessellator.cpp
r9198 r10611 29 29 _errorCode = 0; 30 30 _index=0; 31 32 #ifndef OSG_GLU_AVAILABLE 33 osg::notify(osg::NOTICE)<<"Warning: gluTesselation not supported."<<std::endl; 34 #endif 31 35 } 32 36 … … 40 44 reset(); 41 45 46 #ifdef OSG_GLU_AVAILABLE 42 47 if (!_tobj) _tobj = gluNewTess(); 43 48 … … 50 55 51 56 gluTessBeginPolygon(_tobj,this); 57 #else 58 osg::notify(osg::NOTICE)<<"Warning: gluTesselation not supported."<<std::endl; 59 #endif 52 60 } 53 61 54 62 void Tessellator::beginContour() 55 63 { 64 #ifdef OSG_GLU_AVAILABLE 56 65 if (_tobj) 57 66 { 58 67 gluTessBeginContour(_tobj); 59 68 } 69 #endif 60 70 } 61 71 62 72 void Tessellator::addVertex(osg::Vec3* vertex) 63 73 { 74 #ifdef OSG_GLU_AVAILABLE 64 75 if (_tobj) 65 76 { … … 71 82 gluTessVertex(_tobj,data->_v,vertex); 72 83 } 84 #endif 73 85 } 74 86 75 87 void Tessellator::endContour() 76 88 { 89 #ifdef OSG_GLU_AVAILABLE 77 90 if (_tobj) 78 91 { 79 92 gluTessEndContour(_tobj); 80 93 } 94 #endif 81 95 } 82 96 83 97 void Tessellator::endTessellation() 84 98 { 99 #ifdef OSG_GLU_AVAILABLE 85 100 if (_tobj) 86 101 { … … 95 110 } 96 111 } 112 #endif 97 113 } 98 114 99 115 void Tessellator::reset() 100 116 { 117 #ifdef OSG_GLU_AVAILABLE 101 118 if (_tobj) 102 119 { … … 104 121 _tobj = 0; 105 122 } 123 #endif 106 124 107 125 for (Vec3dList::iterator i = _coordData.begin(); i != _coordData.end(); ++i) … … 167 185 void Tessellator::retessellatePolygons(osg::Geometry &geom) 168 186 { 187 #ifdef OSG_GLU_AVAILABLE 169 188 // turn the contour list into primitives, a little like Tessellator does but more generally 170 189 osg::Vec3Array* vertices = dynamic_cast<osg::Vec3Array*>(geom.getVertexArray()); … … 285 304 collectTessellation(geom, 0); 286 305 } 306 #endif 287 307 } 288 308
