void ShaderEditor::onGUIMenu() { if(ImGui::BeginMenuBar()) { if(ImGui::BeginMenu("File")) { if (ImGui::MenuItem("New")) newGraph(); if (ImGui::MenuItem("Open")) load(); if (ImGui::MenuItem("Save", nullptr, false, m_path.isValid())) save(m_path.c_str()); if (ImGui::MenuItem("Save as")) { getSavePath(); if (m_path.isValid()) save(m_path.c_str()); } ImGui::EndMenu(); } if (ImGui::BeginMenu("Edit")) { if (ImGui::MenuItem("Undo", nullptr, false, canUndo())) undo(); if (ImGui::MenuItem("Redo", nullptr, false, canRedo())) redo(); ImGui::EndMenu(); } if (ImGui::MenuItem("Generate", nullptr, false, m_path.isValid())) { generate(m_path.c_str(), ShaderType::VERTEX); generate(m_path.c_str(), ShaderType::FRAGMENT); generateMain(m_path.c_str()); } ImGui::EndMenuBar(); } }
void beginMainExecution() { // Generate main generateMain(); // Reset expression evaluation stacks operandStack = NULL; operatorStack = NULL; }
void CodeGenerator::generateMainFile(const QDir &directory, const Sprite *bgSprite, const SpriteVector *spriteVec) { writeToFile(directory.filePath(QStringLiteral("main.py")), generateMain(bgSprite, spriteVec)); }