Aggiunta pulsante play
This commit is contained in:
+8
-4
@@ -3,8 +3,8 @@ Pos=60,60
|
|||||||
Size=400,400
|
Size=400,400
|
||||||
|
|
||||||
[Window][Dear ImGui Demo]
|
[Window][Dear ImGui Demo]
|
||||||
Pos=534,1
|
Pos=395,-4
|
||||||
Size=603,680
|
Size=936,873
|
||||||
|
|
||||||
[Window][Hello, world!]
|
[Window][Hello, world!]
|
||||||
Pos=11,12
|
Pos=11,12
|
||||||
@@ -23,8 +23,8 @@ Pos=68,96
|
|||||||
Size=740,472
|
Size=740,472
|
||||||
|
|
||||||
[Window][Set data position]
|
[Window][Set data position]
|
||||||
Pos=10,520
|
Pos=0,522
|
||||||
Size=521,73
|
Size=601,78
|
||||||
|
|
||||||
[Window][Dear ImGui Demo/ResizableChild_478B81A3]
|
[Window][Dear ImGui Demo/ResizableChild_478B81A3]
|
||||||
IsChild=1
|
IsChild=1
|
||||||
@@ -34,3 +34,7 @@ Size=499,136
|
|||||||
IsChild=1
|
IsChild=1
|
||||||
Size=200,100
|
Size=200,100
|
||||||
|
|
||||||
|
[Window][Dear ImGui Style Editor]
|
||||||
|
Pos=60,60
|
||||||
|
Size=353,1005
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
+12
-2
@@ -214,11 +214,22 @@ void doGUI(State &gs)
|
|||||||
ImGui::SliderScalar("Min", ImGuiDataType_U32 ,gs.intervalMinLimit,&zero,gs.intervalMajLimit);
|
ImGui::SliderScalar("Min", ImGuiDataType_U32 ,gs.intervalMinLimit,&zero,gs.intervalMajLimit);
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x * 0.5);
|
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::SameLine();
|
||||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x * 0.8);
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x * 0.8);
|
||||||
ImGui::SliderScalar("Max", ImGuiDataType_U32 ,gs.intervalMajLimit,gs.intervalMinLimit,&gs.maxEntries);
|
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::End();
|
||||||
|
|
||||||
ImGui::SFML::Render(gs.window);
|
ImGui::SFML::Render(gs.window);
|
||||||
@@ -251,7 +262,6 @@ void doGraphics(State &gs)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TODO: add here code to display shapes in your canvas
|
// TODO: add here code to display shapes in your canvas
|
||||||
|
|
||||||
gs.window.display();
|
gs.window.display();
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ int main() {
|
|||||||
|
|
||||||
//Costruisco la GUI
|
//Costruisco la GUI
|
||||||
State gs(800, 600, "Visualizzatore passo",&maj,&min,&pos);
|
State gs(800, 600, "Visualizzatore passo",&maj,&min,&pos);
|
||||||
gs.window.setFramerateLimit(140);
|
gs.window.setFramerateLimit(70);
|
||||||
printf("Costruisco gli oggetti\n");
|
printf("Costruisco gli oggetti\n");
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
|||||||
Reference in New Issue
Block a user