Changeset 11829
- Timestamp:
- 10/07/10 13:53:28 (3 years ago)
- Location:
- OpenSceneGraph/trunk
- Files:
-
- 11 modified
-
examples/osgphotoalbum/PhotoArchive.cpp (modified) (4 diffs)
-
examples/osgtexture3D/osgtexture3D.cpp (modified) (2 diffs)
-
include/osg/GLU (modified) (2 diffs)
-
include/osgUtil/Tessellator (modified) (1 diff)
-
src/osg/Image.cpp (modified) (1 diff)
-
src/osg/glu/libtess/tess.cpp (modified) (13 diffs)
-
src/osg/glu/libtess/tess.h (modified) (3 diffs)
-
src/osg/glu/libutil/error.cpp (modified) (2 diffs)
-
src/osg/glu/libutil/mipmap.cpp (modified) (2 diffs)
-
src/osgPlugins/lwo/Tessellator.cpp (modified) (2 diffs)
-
src/osgText/Glyph.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgphotoalbum/PhotoArchive.cpp
r11828 r11829 216 216 } 217 217 218 PixelStorageModes psm;218 osg::PixelStorageModes psm; 219 219 psm.pack_alignment = image->getPacking(); 220 220 psm.unpack_alignment = image->getPacking(); 221 221 222 GLint status = gluScaleImage(&psm, image->getPixelFormat(),222 GLint status = osg::gluScaleImage(&psm, image->getPixelFormat(), 223 223 image->s(), 224 224 image->t(), … … 234 234 delete [] newData; 235 235 236 osg::notify(osg::WARN) << "Error scaleImage() did not succeed : errorString = "<< gluErrorString((GLenum)status)<<std::endl;236 osg::notify(osg::WARN) << "Error scaleImage() did not succeed : errorString = "<<osg::gluErrorString((GLenum)status)<<std::endl; 237 237 } 238 238 … … 283 283 } 284 284 285 PixelStorageModes psm;285 osg::PixelStorageModes psm; 286 286 psm.pack_alignment = image->getPacking(); 287 287 psm.unpack_alignment = image->getPacking(); 288 288 289 GLint status = gluScaleImage(&psm, image->getPixelFormat(),289 GLint status = osg::gluScaleImage(&psm, image->getPixelFormat(), 290 290 image->s(), 291 291 image->t(), … … 301 301 delete [] newData; 302 302 303 osg::notify(osg::WARN) << "Error scaleImage() did not succeed : errorString = "<< gluErrorString((GLenum)status)<<std::endl;303 osg::notify(osg::WARN) << "Error scaleImage() did not succeed : errorString = "<<osg::gluErrorString((GLenum)status)<<std::endl; 304 304 } 305 305 -
OpenSceneGraph/trunk/examples/osgtexture3D/osgtexture3D.cpp
r6941 r11829 39 39 typedef std::vector< osg::ref_ptr<osg::Image> > ImageList; 40 40 41 42 class MyGraphicsContext {43 public:44 MyGraphicsContext()45 {46 osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;47 traits->x = 0;48 traits->y = 0;49 traits->width = 1;50 traits->height = 1;51 traits->windowDecoration = false;52 traits->doubleBuffer = false;53 traits->sharedContext = 0;54 traits->pbuffer = true;55 56 _gc = osg::GraphicsContext::createGraphicsContext(traits.get());57 58 if (!_gc)59 {60 traits->pbuffer = false;61 _gc = osg::GraphicsContext::createGraphicsContext(traits.get());62 }63 64 if (_gc.valid())65 {66 _gc->realize();67 _gc->makeCurrent();68 }69 }70 71 bool valid() const { return _gc.valid() && _gc->isRealized(); }72 73 private:74 osg::ref_ptr<osg::GraphicsContext> _gc;75 };76 77 78 41 osg::StateSet* createState() 79 42 { 80 MyGraphicsContext gc;81 if (!gc.valid())82 {83 osg::notify(osg::NOTICE)<<"Unable to create the graphics context required to build 3d image."<<std::endl;84 return 0;85 }86 87 43 // read 4 2d images 88 44 osg::ref_ptr<osg::Image> image_0 = osgDB::readImageFile("Images/lz.rgb"); … … 103 59 } 104 60 105 // get max 3D texture size 106 GLint textureSize = osg::Texture3D::getExtensions(0,true)->maxTexture3DSize(); 107 if (textureSize > 256) 108 textureSize = 256; 61 GLint textureSize = 256; 109 62 110 63 // scale them all to the same size. -
OpenSceneGraph/trunk/include/osg/GLU
r11828 r11829 16 16 17 17 #include <osg/GL> 18 19 namespace osg 20 { 18 21 19 22 /* Pixel storage modes, used by gluScaleImage */ … … 164 167 165 168 extern OSG_EXPORT void gluTessBeginContour (GLUtesselator* tess); 166 extern OSG_EXPORT void gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);167 169 extern OSG_EXPORT void gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc); 168 170 extern OSG_EXPORT void gluTessEndContour (GLUtesselator* tess); 169 extern OSG_EXPORT void gluTessEndPolygon (GLUtesselator* tess);170 171 extern OSG_EXPORT void gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ); 171 172 extern OSG_EXPORT void gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data); 172 173 extern OSG_EXPORT void gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data); 174 extern OSG_EXPORT void gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data); 175 extern OSG_EXPORT void gluTessEndPolygon (GLUtesselator* tess); 176 extern OSG_EXPORT void gluGetTessProperty( GLUtesselator *tess, GLenum which, GLdouble *value ); 173 177 178 } 174 179 175 180 #endif // __osgGLU_h -
OpenSceneGraph/trunk/include/osgUtil/Tessellator
r11817 r11829 211 211 typedef std::vector<Vec3d*> Vec3dList; 212 212 213 GLUtesselator* _tobj;213 osg::GLUtesselator* _tobj; 214 214 215 215 PrimList _primList; -
OpenSceneGraph/trunk/src/osg/Image.cpp
r11828 r11829 1004 1004 PixelStorageModes psm; 1005 1005 psm.pack_alignment = _packing; 1006 psm.pack_row_length = _ packing;1006 psm.pack_row_length = _s; 1007 1007 psm.unpack_alignment = _packing; 1008 1008 -
OpenSceneGraph/trunk/src/osg/glu/libtess/tess.cpp
r11818 r11829 55 55 #endif 56 56 57 57 58 /*ARGSUSED*/ static void GLAPIENTRY noBegin( GLenum type ) {} 58 59 /*ARGSUSED*/ static void GLAPIENTRY noEdgeFlag( GLboolean boundaryEdge ) {} … … 90 91 91 92 GLUtesselator * GLAPIENTRY 92 gluNewTess( void )93 osg::gluNewTess( void ) 93 94 { 94 95 GLUtesselator *tess; … … 191 192 192 193 void GLAPIENTRY 193 gluDeleteTess( GLUtesselator *tess )194 osg::gluDeleteTess( GLUtesselator *tess ) 194 195 { 195 196 RequireState( tess, T_DORMANT ); … … 199 200 200 201 void GLAPIENTRY 201 gluTessProperty( GLUtesselator *tess, GLenum which, GLdouble value )202 osg::gluTessProperty( GLUtesselator *tess, GLenum which, GLdouble value ) 202 203 { 203 204 GLenum windingRule; … … 238 239 /* Returns tessellator property */ 239 240 void GLAPIENTRY 240 gluGetTessProperty( GLUtesselator *tess, GLenum which, GLdouble *value )241 osg::gluGetTessProperty( GLUtesselator *tess, GLenum which, GLdouble *value ) 241 242 { 242 243 switch (which) { … … 266 267 267 268 void GLAPIENTRY 268 gluTessNormal( GLUtesselator *tess, GLdouble x, GLdouble y, GLdouble z )269 osg::gluTessNormal( GLUtesselator *tess, GLdouble x, GLdouble y, GLdouble z ) 269 270 { 270 271 tess->normal[0] = x; … … 274 275 275 276 void GLAPIENTRY 276 gluTessCallback( GLUtesselator *tess, GLenum which, _GLUfuncptr fn)277 osg::gluTessCallback( GLUtesselator *tess, GLenum which, _GLUfuncptr fn) 277 278 { 278 279 switch( which ) { … … 413 414 414 415 void GLAPIENTRY 415 gluTessVertex( GLUtesselator *tess, GLdouble coords[3], void *data )416 osg::gluTessVertex( GLUtesselator *tess, GLdouble coords[3], void *data ) 416 417 { 417 418 int i, tooLarge = FALSE; … … 460 461 461 462 void GLAPIENTRY 462 gluTessBeginPolygon( GLUtesselator *tess, void *data )463 osg::gluTessBeginPolygon( GLUtesselator *tess, void *data ) 463 464 { 464 465 RequireState( tess, T_DORMANT ); … … 474 475 475 476 void GLAPIENTRY 476 gluTessBeginContour( GLUtesselator *tess )477 osg::gluTessBeginContour( GLUtesselator *tess ) 477 478 { 478 479 RequireState( tess, T_IN_POLYGON ); … … 491 492 492 493 void GLAPIENTRY 493 gluTessEndContour( GLUtesselator *tess )494 osg::gluTessEndContour( GLUtesselator *tess ) 494 495 { 495 496 RequireState( tess, T_IN_CONTOUR ); … … 498 499 499 500 void GLAPIENTRY 500 gluTessEndPolygon( GLUtesselator *tess )501 osg::gluTessEndPolygon( GLUtesselator *tess ) 501 502 { 502 503 GLUmesh *mesh; … … 591 592 tess->mesh = NULL; 592 593 } 593 594 595 /*XXXblythe unused function*/596 #if 0597 void GLAPIENTRY598 gluDeleteMesh( GLUmesh *mesh )599 {600 __gl_meshDeleteMesh( mesh );601 }602 #endif603 604 605 606 /*******************************************************/607 608 /* Obsolete calls -- for backward compatibility */609 610 void GLAPIENTRY611 gluBeginPolygon( GLUtesselator *tess )612 {613 gluTessBeginPolygon( tess, NULL );614 gluTessBeginContour( tess );615 }616 617 618 /*ARGSUSED*/619 void GLAPIENTRY620 gluNextContour( GLUtesselator *tess, GLenum type )621 {622 gluTessEndContour( tess );623 gluTessBeginContour( tess );624 }625 626 627 void GLAPIENTRY628 gluEndPolygon( GLUtesselator *tess )629 {630 gluTessEndContour( tess );631 gluTessEndPolygon( tess );632 } -
OpenSceneGraph/trunk/src/osg/glu/libtess/tess.h
r11822 r11829 47 47 #include "priorityq.h" 48 48 49 50 49 /* The begin/end calls must be properly nested. We keep track of 51 50 * the current state to enforce the ordering. … … 63 62 } CachedVertex; 64 63 65 struct GLUtesselator {64 struct osg::GLUtesselator { 66 65 67 66 /*** state needed for collecting the input data ***/ … … 169 168 else (*tess->callError)((a)); 170 169 170 // make it easy to introduce the namespace osg for the public functions and typedefs 171 using osg::GLUtesselator; 172 using osg::_GLUfuncptr; 173 174 171 175 #endif -
OpenSceneGraph/trunk/src/osg/glu/libutil/error.cpp
r11821 r11829 36 36 #define GL_TABLE_TOO_LARGE 0x8031 37 37 #endif 38 39 namespace osg 40 { 38 41 39 42 static unsigned char *__gluNurbsErrors[] = { … … 141 144 } 142 145 146 } // end of namespace osg -
OpenSceneGraph/trunk/src/osg/glu/libutil/mipmap.cpp
r11828 r11829 50 50 #include <math.h> 51 51 #include <osg/Notify> 52 53 namespace osg 54 { 52 55 53 56 typedef union { … … 8971 8974 /*** mipmap.c ***/ 8972 8975 8976 } // end of namespace osg -
OpenSceneGraph/trunk/src/osgPlugins/lwo/Tessellator.cpp
r4801 r11829 45 45 last_error_ = 0; 46 46 47 GLUtesselator *tess =gluNewTess();47 osg::GLUtesselator *tess = osg::gluNewTess(); 48 48 49 gluTessCallback(tess, GLU_TESS_BEGIN_DATA, (GLU_TESS_CALLBACK) (cb_begin_data));50 gluTessCallback(tess, GLU_TESS_VERTEX_DATA, (GLU_TESS_CALLBACK) (cb_vertex_data));51 gluTessCallback(tess, GLU_TESS_END_DATA, (GLU_TESS_CALLBACK) (cb_end_data));52 gluTessCallback(tess, GLU_TESS_ERROR_DATA, (GLU_TESS_CALLBACK) (cb_error_data));49 osg::gluTessCallback(tess, GLU_TESS_BEGIN_DATA, (osg::GLU_TESS_CALLBACK) (cb_begin_data)); 50 osg::gluTessCallback(tess, GLU_TESS_VERTEX_DATA, (osg::GLU_TESS_CALLBACK) (cb_vertex_data)); 51 osg::gluTessCallback(tess, GLU_TESS_END_DATA, (osg::GLU_TESS_CALLBACK) (cb_end_data)); 52 osg::gluTessCallback(tess, GLU_TESS_ERROR_DATA, (osg::GLU_TESS_CALLBACK) (cb_error_data)); 53 53 54 gluTessBeginPolygon(tess, this);55 gluTessBeginContour(tess);54 osg::gluTessBeginPolygon(tess, this); 55 osg::gluTessBeginContour(tess); 56 56 57 57 double *vertices = new double[poly.indices().size() * 3]; … … 73 73 } 74 74 75 gluTessEndContour(tess);76 gluTessEndPolygon(tess);77 gluDeleteTess(tess);75 osg::gluTessEndContour(tess); 76 osg::gluTessEndPolygon(tess); 77 osg::gluDeleteTess(tess); 78 78 79 79 delete[] vertices; -
OpenSceneGraph/trunk/src/osgText/Glyph.cpp
r11817 r11829 435 435 if (errorNo!=GL_NO_ERROR) 436 436 { 437 const GLubyte* msg = gluErrorString(errorNo);437 const GLubyte* msg = osg::gluErrorString(errorNo); 438 438 if (msg) { OSG_WARN<<"before Glyph::subload(): detected OpenGL error: "<<msg<<std::endl; } 439 439 else { OSG_WARN<<"before Glyph::subload(): detected OpenGL error number: "<<errorNo<<std::endl; } … … 460 460 461 461 462 const GLubyte* msg = gluErrorString(errorNo);462 const GLubyte* msg = osg::gluErrorString(errorNo); 463 463 if (msg) { OSG_WARN<<"after Glyph::subload() : detected OpenGL error: "<<msg<<std::endl; } 464 464 else { OSG_WARN<<"after Glyph::subload() : detected OpenGL error number: "<<errorNo<<std::endl; }
