| 480 | } |
| 481 | |
| 482 | void RenderGraphEditor::createNewGraph(const std::string& renderGraphName) |
| 483 | { |
| 484 | std::string graphName = renderGraphName; |
| 485 | auto nameToIndexIt = mGraphNamesToIndex.find(graphName); |
| 486 | ref<RenderGraph> newGraph = RenderGraph::create(getDevice()); |
| 487 | |
| 488 | std::string tempGraphName = graphName; |
| 489 | while (mGraphNamesToIndex.find(tempGraphName) != mGraphNamesToIndex.end()) |
| 490 | { |
| 491 | tempGraphName.append("_"); |
| 492 | } |
| 493 | // Matt TODO can we put the GUI dropdown code in a shared function shared with 'loadFromFile'? |
| 494 | graphName = tempGraphName; |
| 495 | newGraph->setName(graphName); |
| 496 | mCurrentGraphIndex = mpGraphs.size(); |
| 497 | mpGraphs.push_back(newGraph); |
| 498 | mRenderGraphUIs.push_back(RenderGraphUI(newGraph, graphName)); |
| 499 | |
| 500 | Gui::DropdownValue nextGraphID; |
| 501 | mGraphNamesToIndex.insert(std::make_pair(graphName, static_cast<uint32_t>(mCurrentGraphIndex))); |
| 502 | nextGraphID.value = static_cast<int32_t>(mOpenGraphNames.size()); |
| 503 | nextGraphID.label = graphName; |
| 504 | mOpenGraphNames.push_back(nextGraphID); |
| 505 | } |
| 506 | |
| 507 | void RenderGraphEditor::onFrameRender(RenderContext* pRenderContext, const ref<Fbo>& pTargetFbo) |
| 508 | { |