- Timestamp:
- 01/16/08 16:07:40 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/Carsten_PtrWork2/Tutorials/13ClusterClientShader.cpp
r739 r1039 60 60 SimpleSceneManager *mgr; 61 61 62 static SHLChunk Ptr _shl = NullFC;63 static Int32 _animation = 1;62 static SHLChunkGlobalRefPtr _shl; 63 static Int32 _animation = 1; 64 64 65 65 // forward declaration so we can have the interesting stuff upfront … … 67 67 68 68 69 Node Ptr createScene(void)70 { 71 Node Ptr _scene;69 NodeTransitPtr createScene(void) 70 { 71 NodeRefPtr _scene; 72 72 73 73 // Create the shader material 74 ChunkMaterial Ptr cmat = ChunkMaterial::create();74 ChunkMaterialRefPtr cmat = ChunkMaterial::create(); 75 75 76 76 // Read the image for the normal texture 77 Image Ptr earth_map_img = Image::create();77 ImageRefPtr earth_map_img = Image::create(); 78 78 if(!earth_map_img->read("Earth.jpg")) 79 79 { 80 80 fprintf(stderr, "Couldn't read texture 'Earth.jpg'\n"); 81 return N ullFC;82 } 83 TextureObjChunk Ptr tex_earth = TextureObjChunk::create();84 TextureEnvChunk Ptr tex_earth_env = TextureEnvChunk::create();81 return NodeTransitPtr(); 82 } 83 TextureObjChunkRefPtr tex_earth = TextureObjChunk::create(); 84 TextureEnvChunkRefPtr tex_earth_env = TextureEnvChunk::create(); 85 85 86 86 tex_earth->setImage(earth_map_img); … … 93 93 94 94 // Read the image for the normal texture 95 Image Ptr earth_night_map_img = Image::create();95 ImageRefPtr earth_night_map_img = Image::create(); 96 96 if(!earth_night_map_img->read("EarthNight.jpg")) 97 97 { 98 98 fprintf(stderr, "Couldn't read texture 'EarthNight.jpg'\n"); 99 return N ullFC;100 } 101 102 TextureObjChunk Ptr tex_earth_night = TextureObjChunk::create();103 TextureEnvChunk Ptr tex_earth_night_env = TextureEnvChunk::create();99 return NodeTransitPtr(); 100 } 101 102 TextureObjChunkRefPtr tex_earth_night = TextureObjChunk::create(); 103 TextureEnvChunkRefPtr tex_earth_night_env = TextureEnvChunk::create(); 104 104 105 105 tex_earth_night->setImage(earth_night_map_img); … … 112 112 113 113 // Read the image for the normal texture 114 Image Ptr earth_clouds_map_img = Image::create();114 ImageRefPtr earth_clouds_map_img = Image::create(); 115 115 if(!earth_clouds_map_img->read("EarthClouds.jpg")) 116 116 { 117 117 fprintf(stderr, "Couldn't read texture 'EarthClouds.jpg'\n"); 118 return N ullFC;119 } 120 121 TextureObjChunk Ptr tex_earth_clouds = TextureObjChunk::create();122 TextureEnvChunk Ptr tex_earth_clouds_env = TextureEnvChunk::create();118 return NodeTransitPtr(); 119 } 120 121 TextureObjChunkRefPtr tex_earth_clouds = TextureObjChunk::create(); 122 TextureEnvChunkRefPtr tex_earth_clouds_env = TextureEnvChunk::create(); 123 123 124 124 tex_earth_clouds->setImage(earth_clouds_map_img); … … 159 159 _scene = Node::create(); 160 160 161 Geometry Ptr geo = makeLatLongSphereGeo (100, 100, 1.0);161 GeometryRefPtr geo = makeLatLongSphereGeo (100, 100, 1.0); 162 162 163 163 geo->setMaterial(cmat); 164 164 165 165 166 Node Ptr torus = Node::create();166 NodeRefPtr torus = Node::create(); 167 167 168 168 torus->setCore(geo); … … 170 170 171 171 // add torus to scene 172 Group Ptr group = Group::create();172 GroupRefPtr group = Group::create(); 173 173 174 174 _scene->setCore(group); 175 175 _scene->addChild(torus); 176 176 177 return _scene;177 return NodeTransitPtr(_scene); 178 178 } 179 179 … … 181 181 int main(int argc, char **argv) 182 182 { 183 char *opt;184 Node Ptr scene=NullFC;183 char *opt; 184 NodeGlobalRefPtr scene; 185 185 186 186 // OSG init … … 191 191 192 192 // the connection between this client and the servers 193 MultiDisplayWindow Ptr mwin= MultiDisplayWindow::create();193 MultiDisplayWindowGlobalRefPtr mwin = MultiDisplayWindow::create(); 194 194 195 195 // evaluate params … … 345 345 case 27: 346 346 { 347 delete mgr; 348 347 349 OSG::osgExit(); 348 350 exit(0);
