Renderer::Renderer( Device* owner ) : ProcessingUnit( owner ) { renderGraphPin = ResourcePin::createResourcePin( Resource::RT_RenderGraph, Pin::PD_In ); renderContentPin = ResourcePin::createResourcePin( Resource::RT_RenderContent, Pin::PD_In ); renderTexturePin = ResourcePin::createResourcePin( Resource::RT_Texture, Pin::PD_Out ); renderWindowPin = ProcessingUnitPin::createProcessingUnitPin( ProcessingUnit::PUT_Window, this, Pin::PD_In ); registerPin( "Renderer.Pin.RenderGraph", renderGraphPin ); registerPin( "Renderer.Pin.RenderContent", renderContentPin ); registerPin( "Renderer.Pin.RenderTarget", renderTexturePin ); registerPin( "Renderer.Pin.RenderWindow", renderWindowPin ); }
boolean RendererD3D11::init() { window = ProcessingUnitPin::createPin( Pin::PD_Output ); registerPin( "window", staticCast<Pin>( window ) ); return true; }
void ContextPrivate::onPinAdded( QSharedPointer<fugio::NodeInterface> pNode, QSharedPointer<fugio::PinInterface> pPin ) { registerPin( pPin ); ConnectionPair MapKey( pNode->name(), pPin->name() ); // DefaultMap::iterator DefaultIterator = mDefaultMap.find( MapKey ); // if( DefaultIterator != mDefaultMap.end() ) // { // pPin->setValue( DefaultIterator.value() ); // } for( ConnectionMap::iterator it = mConnectionMap.begin() ; it != mConnectionMap.end() ; it++ ) { if( pPin->direction() == PIN_OUTPUT && it.key() == MapKey ) { for( NodeHash::iterator NodeIterator = mNodeHash.begin() ; NodeIterator != mNodeHash.end() ; NodeIterator++ ) { QSharedPointer<fugio::NodeInterface> Node = NodeIterator.value(); if( Node->name() != it.value().first ) { continue; } QSharedPointer<fugio::PinInterface> Pin = Node->findPinByName( it.value().second ); if( Pin == 0 || Pin->direction() != PIN_INPUT ) { continue; } connectPins( pPin->globalId(), Pin->globalId() ); } break; } else if( pPin->direction() == PIN_INPUT && it.value() == MapKey ) { for( NodeHash::iterator NodeIterator = mNodeHash.begin() ; NodeIterator != mNodeHash.end() ; NodeIterator++ ) { QSharedPointer<fugio::NodeInterface> Node = *NodeIterator; if( Node->name() != it.key().first ) { continue; } QSharedPointer<fugio::PinInterface> Pin = Node->findPinByName( it.key().second ); if( Pin == 0 || Pin->direction() != PIN_OUTPUT ) { continue; } connectPins( pPin->globalId(), Pin->globalId() ); } break; } } emit pinAdded( pNode->uuid(), pPin->globalId() ); }