void BlockPrinter(const ndn::Block& block, const std::string& indent = "") { std::cout << indent; printTypeInfo(block.type()); std::cout << " (size: " << block.value_size() << ")"; try { // if (block.type() != ndn::Tlv::Content && block.type() != ndn::Tlv::SignatureValue) block.parse(); } catch (ndn::Tlv::Error& e) { // pass (e.g., leaf block reached) // @todo: Figure how to deterministically figure out that value is not recursive TLV block } if (block.elements().empty()) { std::cout << " [["; ndn::name::Component(block.value(), block.value_size()).toUri(std::cout); std::cout<< "]]"; } std::cout << std::endl; for (ndn::Block::element_const_iterator i = block.elements_begin(); i != block.elements_end(); ++i) { BlockPrinter(*i, indent+" "); } }
/** * Show detailed information for all uniforms of this program */ void SciIllLib::CGLShaderProgram::showUniformInformation() { std::cout << "Getting ShaderProgram uniform information: " << std::endl; int count = 0; glGetProgramiv(m_hndProgram, GL_ACTIVE_UNIFORMS, &count); if (count == 0) { std::cout << "--> No uniforms defined!" << std::endl; return; } GLsizei bufSize = 256; GLint size; GLsizei length; GLenum type; char* name = new char[bufSize]; for (int idx=0; idx < count; idx++) { glGetActiveUniform(m_hndProgram, idx, bufSize, &length, &size, &type, name); std::cout << "- " << idx << ":" << name << ", "; printTypeInfo(type); std::cout << std::endl; } }