Changeset 148 for osgVisual/src/distortion
- Timestamp:
- Nov 7, 2010, 8:02:38 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/src/distortion/visual_distortion.cpp
r147 r148 23 23 OSG_NOTIFY (osg::ALWAYS ) << "visual_distortion instantiated." << std::endl; 24 24 25 this->configFileName = configFileName; 25 26 initialized = false; 26 27 distortionEnabled = false; … … 37 38 { 38 39 OSG_NOTIFY (osg::ALWAYS ) << "visual_distortion destroyed." << std::endl; 40 } 41 42 bool visual_distortion::processXMLConfiguration() 43 { 44 // Init XML 45 xmlDoc* tmpDoc; 46 xmlNode* config = util::getModuleXMLConfig( configFileName, "distortion", tmpDoc ); 47 if(config) 48 { 49 xmlNode* a_node = config; 50 // Extract infos 51 std::string name = ""; 52 bool enabled = false; 53 54 xmlAttr *attr = a_node->properties; 55 while ( attr ) 56 { 57 std::string attr_name=reinterpret_cast<const char*>(attr->name); 58 std::string attr_value=reinterpret_cast<const char*>(attr->children->content); 59 if( attr_name == "name" ) 60 name = reinterpret_cast<const char*>(attr->children->content); 61 if( attr_name == "enabled" && attr_value== "yes" ) 62 enabled = true; 63 if( attr_name == "enabled" && attr_value== "no" ) 64 enabled = false; 65 66 attr = attr->next; 67 } 68 OSG_ALWAYS << "Module '" << name << "' found. Enabled = " << enabled << std::endl; 69 } 70 71 // extract configuration values 72 73 // clean up 74 if(tmpDoc) 75 { 76 xmlFreeDoc(tmpDoc); xmlCleanupParser(); 77 return true; 78 } 79 80 return true; 39 81 } 40 82 … … 64 106 65 107 // Read out Distortion CMDLine arguments 66 while (arguments.read("--width", tex_width)) {}67 while (arguments.read("--height", tex_height)) {}68 69 while (arguments.read("--fbo")) { renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; }70 71 72 73 74 75 while (arguments.read("--texture-rectangle")) { useTextureRectangle = true; }76 77 while (arguments.read("--shaderDistortion")) { useShaderDistortion = true; }78 79 while (arguments.read("--hdr")) { useHDR = true; }80 81 while (arguments.read("--distortionmap", distortMapFileName)) { }82 while (arguments.read("--blendmap", blendMapFileName)) { }108 //while (arguments.read("--width", tex_width)) {} 109 //while (arguments.read("--height", tex_height)) {} 110 111 //while (arguments.read("--fbo")) { renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT; } 112 //while (arguments.read("--pbuffer")) { renderImplementation = osg::Camera::PIXEL_BUFFER; } 113 //while (arguments.read("--pbuffer-rtt")) { renderImplementation = osg::Camera::PIXEL_BUFFER_RTT; } 114 //while (arguments.read("--fb")) { renderImplementation = osg::Camera::FRAME_BUFFER; } 115 //while (arguments.read("--window")) { renderImplementation = osg::Camera::SEPERATE_WINDOW; } 116 117 //while (arguments.read("--texture-rectangle")) { useTextureRectangle = true; } 118 119 //while (arguments.read("--shaderDistortion")) { useShaderDistortion = true; } 120 121 //while (arguments.read("--hdr")) { useHDR = true; } 122 123 //while (arguments.read("--distortionmap", distortMapFileName)) { } 124 //while (arguments.read("--blendmap", blendMapFileName)) { } 83 125 84 126 std::string pre_cfg("..\\resources\\distortion\\view_");
Note: See TracChangeset
for help on using the changeset viewer.