//relay the extension of the changed face file public void changeFace(object a, Update_Face_Event e) { //the face number is appended at the end String file_ext = e.file_extension +screen.ToString(); change_face(this, new Update_Face_Event(file_ext)); }
/// <summary> /// Applies a new texture to the cube representing last state of closed form. /// </summary> /// <param name="a"></param> /// <param name="e"></param> public void getNewFace(object a, Update_Face_Event e) { //##############################################| //----------------------------------------------| //face information... | //----------------------------------------------| //face numbers | //----------------------------------------------| //0 is red | //1 is purple | //2 is to face of cube | //3 is the bottom face of cube | //4 is yellow | //5 is orange | //----------------------------------------------| //face order when spinning from beginning | //----------------------------------------------| //purple orange red yellow | //##############################################| //parse the string to take out the number... String temp = e.file_extension; String ext = temp.Substring(0, (temp.Length - 1)); String faceNum = temp.Substring(temp.Length - 1, 1); int index = Convert.ToInt32(faceNum); switch (index) { //first face case 0: //set it to the purple face //mirror the extension form_utilities.mirrorImage(ext); SRVlist[1] = ShaderResourceView.FromFile(device, ext); break; //second face case 1: //set it to the orange face SRVlist[5] = ShaderResourceView.FromFile(device, ext); break; //third face case 2: //set it to the red face SRVlist[0] = ShaderResourceView.FromFile(device, ext); break; //fourth face case 3: //set it to the yellow face //mirror the face due to culling form_utilities.mirrorImage(ext); SRVlist[4] = ShaderResourceView.FromFile(device, ext); break; } }