From 313ca58550163380e072880b360bc6076d27c8e5 Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Wed, 27 Jul 2022 15:46:42 -0400 Subject: switched threading to SDL; works on windows now --- my_imgui_widgets.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'my_imgui_widgets.cpp') diff --git a/my_imgui_widgets.cpp b/my_imgui_widgets.cpp index 1190430..440694b 100644 --- a/my_imgui_widgets.cpp +++ b/my_imgui_widgets.cpp @@ -200,7 +200,7 @@ ImGui_Viewport(project_data File, project_state *State, ui *UI, pixel_buffer Com // { // Debug.ToggleRenders = true; // } - ImGui::OpenPopupOnItemClick("context", ImGuiPopupFlags_MouseButtonRight); + ImGui::OpenPopupOnItemClick("context", ImGuiPopupFlags_MouseButtonMiddle); if (ImGui::BeginPopup("context")) { if (ImGui::MenuItem("Scalar", NULL, false, InstructionMode != scalar_only)) { InstructionMode = scalar_only; } if (ImGui::MenuItem("SSE", NULL, false, InstructionMode != sse_enabled)) { InstructionMode = sse_enabled; } @@ -295,6 +295,15 @@ ImGui_File(project_data *File, project_state *State, memory *Memory, ui *UI, ImG State->DemoButton = false; } } + if (State->GridButton) { + ImGui::SameLine(); + if (ImGui::Button("Generate square grid")) { + CreateGrid(File, Memory); + State->UpdateKeyframes = true; + State->UpdateFrame = true; + State->GridButton = false; + } + } for (int16 i = 0; i < File->NumberOfSources; i++) { ImGui::PushID(i); ImGui::InputText("##source", File->Source[i], STRING_SIZE); @@ -932,14 +941,16 @@ ImGui_Timeline(project_data *File, project_state *State, memory *Memory, ui *UI, if (IsRectTouching(WindowMinAbs, WindowMaxAbs, io.MousePos, io.MousePos + 1)) { if (io.KeyCtrl && io.MouseWheel) { - real32 ZoomAmount = io.MouseWheel*8; + real32 ZoomAmount = io.MouseWheel*16; real32 LocalMousePos = ImGui::GetMousePos().x - TimelineStartingPos.x; real32 ZoomRatio = LocalMousePos / UI->TimelineZoom; UI->TimelineZoom += ZoomAmount; UI->ScrollXOffset -= ZoomAmount*ZoomRatio; + } else if (io.KeyShift && io.MouseWheel) { + UI->ScrollXOffset += io.MouseWheel*16; } else { - UI->ScrollXOffset += io.MouseWheelH*8; - UI->ScrollYOffset += io.MouseWheel*8; + UI->ScrollXOffset += io.MouseWheelH*16; + UI->ScrollYOffset += io.MouseWheel*16; } } @@ -987,6 +998,9 @@ ImGui_ProcessInputs(project_data *File, project_state *State, pixel_buffer *Comp if (ImGui::IsKeyPressed(ImGuiKey_A) && State->NumberOfSelectedLayers) TransformsInteract(File, State, UI, sliding_anchorpoint); + if (ImGui::IsKeyPressed(ImGuiKey_1)) + LoadTestFootage(File, State, Memory); + if (ImGui::IsKeyPressed(ImGuiKey_Delete)) { switch (State->RecentSelectionType) @@ -1010,11 +1024,6 @@ ImGui_ProcessInputs(project_data *File, project_state *State, pixel_buffer *Comp } #if DEBUG - if (ImGui::IsKeyPressed(ImGuiKey_Z)) - { - // SwitchBool(D); - // State->UpdateFrame = true; - } if (ImGui::IsKeyPressed(ImGuiKey_M)) { Debug.Markers[Debug.MarkerIndex] = File->CurrentFrame; -- cgit v1.2.3