GUI: new osc renderer, part 26

sorry another window
This commit is contained in:
tildearrow 2024-02-20 15:40:48 -05:00
parent 086c792d33
commit e17df27f66
6 changed files with 71 additions and 5 deletions

View file

@ -4674,6 +4674,30 @@ bool FurnaceGUI::loop() {
MEASURE(effectList,drawEffectList());
}
// NEW CODE - REMOVE WHEN DONE
if (ImGui::Begin("Shader Editor 2024",NULL)) {
ImGui::PushFont(patFont);
ImGui::InputTextMultiline("##SHFragment",&newOscFragment,ImVec2(ImGui::GetContentRegionAvail().x,ImGui::GetContentRegionAvail().y-ImGui::GetFrameHeightWithSpacing()),ImGuiInputTextFlags_UndoRedo);
ImGui::PopFont();
if (ImGui::Button("Save")) {
FILE* f=ps_fopen("/storage/emulated/0/osc.fsh","w");
if (f==NULL) {
showError("Something happened");
} else {
fwrite(newOscFragment.c_str(),1,newOscFragment.size(),f);
fclose(f);
showError("Saved!");
}
}
ImGui::SameLine();
if (ImGui::Button("Apply")) {
if (!rend->regenOscShader(newOscFragment.c_str())) {
showError("Of course you screwed it up, again!");
}
}
}
ImGui::End();
// release selection if mouse released
if (ImGui::IsMouseReleased(ImGuiMouseButton_Left) && selecting) {
if (!selectingFull) cursor=selEnd;
@ -6950,6 +6974,9 @@ bool FurnaceGUI::init() {
ImGui::CreateContext();
rend->initGUI(sdlWin);
// NEW CODE - REMOVE WHEN DONE
newOscFragment=rend->getStupidFragment();
applyUISettings();
logD("building font...");