From: Ash Tyndall Date: Sat, 8 Oct 2011 05:28:06 +0000 (+0800) Subject: (no commit message) X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=a44934800298258bf8f14e4a704725d9f6279f86;p=atyndall%2Fcits2231.git --- diff --git a/scene.c b/scene.c index df115d1..18cb9fb 100644 --- a/scene.c +++ b/scene.c @@ -216,10 +216,7 @@ const char *objectMenuEntries[NMESH] = { "51 Chef", "52 Parasaurolophus", "53 Rooster", "54 T-rex" }; -const char *materialMenuEntries[8] = { - "All R/G/B", "Ambient R/G/B", "Diffuse R/G/B", "Specular R/G/B", - "All Amb/Diff/Spec/Shine", "Red Amb/Diff/Spec/Shine", "Green Amb/Diff/Spec/Shine", "Blue Amb/Diff/Spec/Shine" -}; + void processMainEvents(int id) { switch (id) { @@ -252,13 +249,27 @@ void processLightEvents(int id) { void makeMenu() { - glutCreateMenu(processMainEvents); + int mainMenu = glutCreateMenu(processMainEvents); glutAddMenuEntry("Rotate/Move Camera", ROTATE_MOVE_CAMERA); //Add object glutAddMenuEntry("Position/Scale", POSITION_SCALE); glutAddMenuEntry("Rotation/Texture Scale", ROTATION_TEXTURE_SCALE); //material + + int materialMenu = glutCreateMenu(processMaterialEvents); + glutAddMenuEntry("All R/G/B", MATERIAL_ALL_RGB); + glutAddMenuEntry("Ambient R/G/B", MATERIAL_AMBIENT_RGB); + glutAddMenuEntry("Diffuse R/G/B", MATERIAL_DIFFUSE_RGB); + glutAddMenuEntry("Specular R/G/B", MATERIAL_SPECULAR_RGB); + glutAddMenuEntry("All Amb/Diff/Spec/Shine", MATERIAL_ALL_ADSS); + glutAddMenuEntry("Red Amb/Diff/Spec/Shine", MATERIAL_RED_ADSS); + glutAddMenuEntry("Green Amb/Diff/Spec/Shine", MATERIAL_GREEN_ADSS); + glutAddMenuEntry("Blue Amb/Diff/Spec/Shine", MATERIAL_BLUE_ADSS); + + glutSetMenu(mainMenu); + glutAddSubMenu("Material", materialMenu); + //texture //ground texture //lights