(no commit message)
authorAsh Tyndall <[email protected]>
Sat, 8 Oct 2011 05:28:06 +0000 (13:28 +0800)
committerAsh Tyndall <[email protected]>
Sat, 8 Oct 2011 05:28:06 +0000 (13:28 +0800)
scene.c

diff --git a/scene.c b/scene.c
index df115d1..18cb9fb 100644 (file)
--- a/scene.c
+++ b/scene.c
@@ -216,10 +216,7 @@ const char *objectMenuEntries[NMESH] = {
   "51 Chef", "52 Parasaurolophus", "53 Rooster", "54 T-rex"\r
 };\r
 \r
-const char *materialMenuEntries[8] = {\r
-  "All R/G/B", "Ambient R/G/B", "Diffuse R/G/B", "Specular R/G/B",\r
-  "All Amb/Diff/Spec/Shine", "Red Amb/Diff/Spec/Shine", "Green Amb/Diff/Spec/Shine", "Blue Amb/Diff/Spec/Shine"\r
-};\r
+\r
 \r
 void processMainEvents(int id) {\r
   switch (id) {\r
@@ -252,13 +249,27 @@ void processLightEvents(int id) {
 \r
 \r
 void makeMenu() {\r
-  glutCreateMenu(processMainEvents);\r
+  int mainMenu = glutCreateMenu(processMainEvents);\r
 \r
   glutAddMenuEntry("Rotate/Move Camera", ROTATE_MOVE_CAMERA);\r
   //Add object\r
   glutAddMenuEntry("Position/Scale", POSITION_SCALE);\r
   glutAddMenuEntry("Rotation/Texture Scale", ROTATION_TEXTURE_SCALE);\r
   //material\r
+  \r
+  int materialMenu = glutCreateMenu(processMaterialEvents);\r
+  glutAddMenuEntry("All R/G/B", MATERIAL_ALL_RGB);\r
+  glutAddMenuEntry("Ambient R/G/B", MATERIAL_AMBIENT_RGB);\r
+  glutAddMenuEntry("Diffuse R/G/B", MATERIAL_DIFFUSE_RGB);\r
+  glutAddMenuEntry("Specular R/G/B", MATERIAL_SPECULAR_RGB);\r
+  glutAddMenuEntry("All Amb/Diff/Spec/Shine", MATERIAL_ALL_ADSS);\r
+  glutAddMenuEntry("Red Amb/Diff/Spec/Shine", MATERIAL_RED_ADSS);\r
+  glutAddMenuEntry("Green Amb/Diff/Spec/Shine", MATERIAL_GREEN_ADSS);\r
+  glutAddMenuEntry("Blue Amb/Diff/Spec/Shine", MATERIAL_BLUE_ADSS);\r
+\r
+  glutSetMenu(mainMenu);\r
+  glutAddSubMenu("Material", materialMenu);\r
+  \r
   //texture\r
   //ground texture\r
   //lights\r

UCC git Repository :: git.ucc.asn.au