@@ -74,7 +74,6 @@ protected override void OnRenderFrame(FrameEventArgs e)
7474
7575 if ( _shapes != null )
7676 {
77-
7877 _shapes [ 0 ] . UpdateProperties ( ) ;
7978 _shapes [ 0 ] . Draw ( ) ;
8079 }
@@ -91,12 +90,14 @@ protected override void OnUnload()
9190 {
9291 base . OnUnload ( ) ;
9392
93+ Console . WriteLine ( "Program stops" ) ;
94+
9495 GL . BindBuffer ( BufferTarget . ArrayBuffer , 0 ) ;
9596 GL . BindBuffer ( BufferTarget . ElementArrayBuffer , 0 ) ;
9697 GL . BindVertexArray ( 0 ) ;
9798 GL . UseProgram ( 0 ) ;
9899
99- // TODO: Delete the buffer in the Shape class
100+ _shapes . ForEach ( shape => shape . DeleteObjects ( ) ) ;
100101 }
101102 public void ShowUI ( )
102103 {
@@ -106,6 +107,7 @@ public void ShowUI()
106107 ImGui . GetStyle ( ) . TabRounding = 0.0f ;
107108
108109
110+ // Parameters side
109111 ImGui . Begin ( "Parameters" , ImGuiWindowFlags . NoCollapse | ImGuiWindowFlags . NoResize | ImGuiWindowFlags . NoMove | ImGuiWindowFlags . NoTitleBar ) ;
110112 ImGui . SetWindowSize ( new System . Numerics . Vector2 ( 200 , ClientSize . Y / 2 ) ) ;
111113 ImGui . SetWindowPos ( new System . Numerics . Vector2 ( ClientSize . X - ImGui . GetWindowWidth ( ) , 0 ) ) ;
@@ -125,10 +127,9 @@ public void ShowUI()
125127 ImGui . Text ( "Color" ) ;
126128 ImGui . Spacing ( ) ;
127129 ImGui . ColorEdit4 ( "Color" , ref _ioColor ) ;
128-
129130 ImGui . End ( ) ;
130131
131-
132+ // Tree view side
132133 ImGui . Begin ( "Tree view" , ImGuiWindowFlags . NoCollapse | ImGuiWindowFlags . NoResize | ImGuiWindowFlags . NoMove | ImGuiWindowFlags . NoTitleBar ) ;
133134 ImGui . SetWindowSize ( new System . Numerics . Vector2 ( 200 , ClientSize . Y / 2 ) ) ;
134135 ImGui . SetWindowPos ( new System . Numerics . Vector2 ( ClientSize . X - ImGui . GetWindowWidth ( ) , ClientSize . Y / 2 ) ) ;
@@ -140,24 +141,23 @@ public void ShowUI()
140141 ImGui . Selectable ( "Rectangle" ) ;
141142 ImGui . End ( ) ;
142143
143-
144+ // Animation side
144145 ImGui . Begin ( "Animation" , ImGuiWindowFlags . NoCollapse | ImGuiWindowFlags . NoResize | ImGuiWindowFlags . NoMove | ImGuiWindowFlags . NoTitleBar ) ;
145146 ImGui . SetWindowSize ( new System . Numerics . Vector2 ( ClientSize . X / 2 , 200 ) ) ;
146147 ImGui . SetWindowPos ( new System . Numerics . Vector2 ( 0 , ClientSize . Y - ImGui . GetWindowHeight ( ) ) ) ;
147148 ImGui . Text ( "Animation" ) ;
148149 ImGui . End ( ) ;
149150
150-
151+ // Timeline side
151152 ImGui . Begin ( "Timeline" , ImGuiWindowFlags . NoCollapse | ImGuiWindowFlags . NoResize | ImGuiWindowFlags . NoMove | ImGuiWindowFlags . NoTitleBar ) ;
152153 ImGui . SetWindowSize ( new System . Numerics . Vector2 ( ClientSize . X / 2 - 200 , 200 ) ) ;
153154 ImGui . SetWindowPos ( new System . Numerics . Vector2 ( ClientSize . X / 2 , ClientSize . Y - ImGui . GetWindowHeight ( ) ) ) ;
154155 ImGui . Text ( "Timeline" ) ;
155156 ImGui . Spacing ( ) ;
156157 ImGui . SliderInt ( "(seconds)" , ref _ioTimeline , 0 , 60 ) ;
157-
158158 ImGui . End ( ) ;
159159
160-
160+ // Navbar side
161161 ImGui . Begin ( "NavBar" , ImGuiWindowFlags . NoCollapse | ImGuiWindowFlags . NoResize | ImGuiWindowFlags . NoMove | ImGuiWindowFlags . NoTitleBar | ImGuiWindowFlags . MenuBar ) ;
162162 ImGui . SetWindowSize ( new System . Numerics . Vector2 ( ClientSize . X - 200 , 0 ) ) ;
163163 ImGui . SetWindowPos ( new System . Numerics . Vector2 ( 0 , 0 ) ) ;
@@ -167,9 +167,7 @@ public void ShowUI()
167167 if ( ImGui . BeginMenu ( "File" ) )
168168 {
169169 if ( ImGui . MenuItem ( "Open.." , "Ctrl+O" ) )
170- {
171170 _dialogFilePicker = true ;
172- }
173171 if ( ImGui . BeginMenu ( "Save" ) )
174172 {
175173 if ( ImGui . MenuItem ( "Save as PNG" , "Ctrl+S" ) )
@@ -199,10 +197,10 @@ public void ShowUI()
199197 ImGui . EndPopup ( ) ;
200198 }
201199
200+ // File picker dialog
202201 if ( _dialogFilePicker )
203202 ImGui . OpenPopup ( "open-file" ) ;
204-
205- if ( ImGui . BeginPopupModal ( "open-file" ) )
203+ if ( ImGui . BeginPopupModal ( "open-file" ) ) // ImGuiWindowFlags.AlwaysAutoResize
206204 {
207205 var picker = FilePicker . GetFilePicker ( this , Path . Combine ( Environment . CurrentDirectory , "Content/Atlases" ) , ".svg" ) ;
208206 if ( picker . Draw ( ) )
@@ -211,18 +209,17 @@ public void ShowUI()
211209 _shapes . ForEach ( shape => shape . GenerateObjects ( ) ) ;
212210 FilePicker . RemoveFilePicker ( this ) ;
213211 if ( compatibilityFlag )
214- {
215212 _dialogCompatibility = true ;
216- }
217213
218214 }
219215 _dialogFilePicker = false ;
220216 ImGui . EndPopup ( ) ;
221217 }
222218
219+ // Compatibility alert
223220 if ( _dialogCompatibility )
224221 ImGui . OpenPopup ( "Compatibility Problem" ) ;
225- if ( ImGui . BeginPopupModal ( "Compatibility Problem" ) )
222+ if ( ImGui . BeginPopupModal ( "Compatibility Problem" ) ) // ImGuiWindowFlags.AlwaysAutoResize
226223 {
227224 ImGui . Text ( "Some SVG elements are not compatible. Go to the list of compatible SVG elements" ) ;
228225 ImGui . Separator ( ) ;
0 commit comments