diff --git a/build/bin/imgui.ini b/build/bin/imgui.ini index 0d64693..3c3fe44 100644 --- a/build/bin/imgui.ini +++ b/build/bin/imgui.ini @@ -3,8 +3,8 @@ Pos=60,60 Size=400,400 [Window][Dear ImGui Demo] -Pos=534,1 -Size=603,680 +Pos=395,-4 +Size=936,873 [Window][Hello, world!] Pos=11,12 @@ -23,8 +23,8 @@ Pos=68,96 Size=740,472 [Window][Set data position] -Pos=10,520 -Size=521,73 +Pos=0,522 +Size=601,78 [Window][Dear ImGui Demo/ResizableChild_478B81A3] IsChild=1 @@ -34,3 +34,7 @@ Size=499,136 IsChild=1 Size=200,100 +[Window][Dear ImGui Style Editor] +Pos=60,60 +Size=353,1005 + diff --git a/build/bin/mainV5 b/build/bin/mainV5 index d7328e1..9307752 100755 Binary files a/build/bin/mainV5 and b/build/bin/mainV5 differ diff --git a/src/sfml_util.cpp b/src/sfml_util.cpp index 7fe67e7..b5189e8 100644 --- a/src/sfml_util.cpp +++ b/src/sfml_util.cpp @@ -214,11 +214,22 @@ void doGUI(State &gs) ImGui::SliderScalar("Min", ImGuiDataType_U32 ,gs.intervalMinLimit,&zero,gs.intervalMajLimit); ImGui::SameLine(); ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x * 0.5); - ImGui::SliderScalar("Pos", ImGuiDataType_U32 ,gs.pos,gs.intervalMinLimit,gs.intervalMajLimit); + if (ImGui::SliderScalar("Pos", ImGuiDataType_U32 ,gs.pos,gs.intervalMinLimit,gs.intervalMajLimit)){ + gs.play = false; + } ImGui::SameLine(); ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x * 0.8); ImGui::SliderScalar("Max", ImGuiDataType_U32 ,gs.intervalMajLimit,gs.intervalMinLimit,&gs.maxEntries); - + + bool red = false; + if (!gs.play){ + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1,0,0,1)); + red = true; + } + if (ImGui::ArrowButton("Play", ImGuiDir_Right)){ + gs.play = !gs.play; + } + if (red) ImGui::PopStyleColor(); ImGui::End(); ImGui::SFML::Render(gs.window); @@ -249,7 +260,6 @@ void doGraphics(State &gs) } doGUI(gs); - // TODO: add here code to display shapes in your canvas diff --git a/src/testMain.cpp b/src/testMain.cpp index dc6c073..8aac84d 100755 --- a/src/testMain.cpp +++ b/src/testMain.cpp @@ -37,7 +37,7 @@ int main() { //Costruisco la GUI State gs(800, 600, "Visualizzatore passo",&maj,&min,&pos); - gs.window.setFramerateLimit(140); + gs.window.setFramerateLimit(70); printf("Costruisco gli oggetti\n"); try{