Mercurial > public > algo-animator
comparison src/main.c @ 31:61104b22a25d
I think it is working now...
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Thu, 29 Jun 2023 18:05:22 +0100 |
parents | f945bcc3571f |
children | b1a605eb721a |
comparison
equal
deleted
inserted
replaced
30:f945bcc3571f | 31:61104b22a25d |
---|---|
129 render_text(window_width - 400, window_height - 80, text); | 129 render_text(window_width - 400, window_height - 80, text); |
130 } | 130 } |
131 | 131 |
132 // Bottom: Column 1 | 132 // Bottom: Column 1 |
133 render_text(20, vpadding - 50, "Press a or s to select an algorithm."); | 133 render_text(20, vpadding - 50, "Press a or s to select an algorithm."); |
134 render_text(20, vpadding - 80, "Press u or d to modify speed."); | 134 render_text(20, vpadding - 80, "Press u or d to change the delay."); |
135 render_text(20, vpadding - 110, "Press r to randomize the array."); | 135 render_text(20, vpadding - 110, "Press r to reset."); |
136 | 136 |
137 // Bottom: Column 2 | 137 // Bottom: Column 2 |
138 render_text(800, vpadding - 50, "Press enter to run the algorithm."); | 138 render_text(800, vpadding - 50, "Press enter to run or resume the algorithm."); |
139 render_text(800, vpadding - 80, "Press p to pause the algorithm."); | 139 render_text(800, vpadding - 80, "Press p to pause."); |
140 render_text(800, vpadding - 110, "Press q to enable or disable sequential mode."); | 140 render_text(800, vpadding - 110, "Press q to enable or disable sequential mode."); |
141 | 141 |
142 glutSwapBuffers(); | 142 glutSwapBuffers(); |
143 } | 143 } |
144 | 144 |
165 reset_state(&algo_args, &thread_state); | 165 reset_state(&algo_args, &thread_state); |
166 } | 166 } |
167 | 167 |
168 // u: Increase speed | 168 // u: Increase speed |
169 if (key == 117) { | 169 if (key == 117) { |
170 change_speed(&algo_args, 10); | 170 change_delay(&algo_args, 10); |
171 } | 171 } |
172 | 172 |
173 // d: reduce speed | 173 // d: reduce speed |
174 if (key == 100) { | 174 if (key == 100) { |
175 change_speed(&algo_args, -10); | 175 change_delay(&algo_args, -10); |
176 } | 176 } |
177 | 177 |
178 // enter: Run program | 178 // enter: Run program |
179 if (key == 13) { | 179 if (key == 13) { |
180 run(&algo_args, algos, selected_algo, &thread_state); | 180 run(&algo_args, algos, selected_algo, &thread_state); |