|
24 | 24 | #include "scene/Light.h" |
25 | 25 | #include "scene/surface/Surface.h" |
26 | 26 |
|
| 27 | +#include "ImguiSections.h" |
| 28 | + |
27 | 29 | enum shaderEnum |
28 | 30 | { |
29 | 31 | GOURAND, |
@@ -299,42 +301,19 @@ int main() |
299 | 301 | if (ImGui::CollapsingHeader("Geometric objects")) |
300 | 302 | { |
301 | 303 | ImGui::Indent(); |
302 | | - |
303 | | - ImGui::RadioButton("Crumbled", &nextObject, CRUMPLED); |
304 | | - ImGui::RadioButton("Cube", &nextObject, CUBE); |
305 | | - ImGui::RadioButton("Double torus", &nextObject, DOUBLETORUS); |
306 | | - ImGui::RadioButton("Fandisk", &nextObject, FANDISK); |
307 | | - ImGui::RadioButton("Icosahedron", &nextObject, ICOSA); |
308 | | - ImGui::RadioButton("Octahedron", &nextObject, OCTA); |
309 | | - ImGui::RadioButton("Oloid", &nextObject, OLOID); |
310 | | - ImGui::RadioButton("Sphere", &nextObject, SPHERE); |
311 | | - ImGui::RadioButton("Star", &nextObject, STAR); |
312 | | - ImGui::RadioButton("T-Shape", &nextObject, T); |
313 | | - ImGui::RadioButton("Torus", &nextObject, TORUS); |
314 | | - ImGui::RadioButton("Tubes", &nextObject, TUBES); |
315 | | - |
| 304 | + for (std::pair<unsigned int, const char *> displayName : geometricObjectNames) |
| 305 | + { |
| 306 | + ImGui::RadioButton(displayName.second, &nextObject, displayName.first); |
| 307 | + } |
316 | 308 | ImGui::Unindent(); |
317 | 309 | } |
318 | 310 | if (ImGui::CollapsingHeader("Model objects")) |
319 | 311 | { |
320 | 312 | ImGui::Indent(); |
321 | | - |
322 | | - ImGui::RadioButton("Ankylosaurus", &nextObject, ANKYLOSAURUS); |
323 | | - ImGui::RadioButton("Armadillo", &nextObject, ARMADILLO); |
324 | | - ImGui::RadioButton("Bob (Tri)", &nextObject, BOB); |
325 | | - ImGui::RadioButton("Bob (Quad)", &nextObject, BOB2); |
326 | | - ImGui::RadioButton("Bunny", &nextObject, BUNNY); |
327 | | - ImGui::RadioButton("Cow (Tri)", &nextObject, COW); |
328 | | - ImGui::RadioButton("Cow (Mixed)", &nextObject, COW2); |
329 | | - ImGui::RadioButton("Cow head", &nextObject, COWHEAD); |
330 | | - ImGui::RadioButton("Face", &nextObject, FACE); |
331 | | - ImGui::RadioButton("Gargoyle", &nextObject, GARGOYLE); |
332 | | - ImGui::RadioButton("Kitten", &nextObject, KITTEN); |
333 | | - ImGui::RadioButton("Shuttle", &nextObject, SHUTTLE); |
334 | | - ImGui::RadioButton("Suzanne", &nextObject, SUZANNE); |
335 | | - ImGui::RadioButton("Teapot", &nextObject, TEAPOT); |
336 | | - ImGui::RadioButton("Teddy", &nextObject, TEDDY); |
337 | | - |
| 313 | + for (std::pair<unsigned int, const char*> displayName : modelObjectNames) |
| 314 | + { |
| 315 | + ImGui::RadioButton(displayName.second, &nextObject, displayName.first); |
| 316 | + } |
338 | 317 | ImGui::Unindent(); |
339 | 318 | } |
340 | 319 | ImGui::Unindent(); |
|
0 commit comments