int MyListOfObjects[256];bool RenderComplete = false;//// sort the objects in here...////for (int count = 0; count < 256; count++){ switch(MyListOfObjects[count]) { case 0: { RenderComplete = true; break; } case 1: { FuncitonToDrawSomeObject(); break; } ... etc... } if (RenderComplete) break;}
You should probably use an enum list so that you get statements like case FIRSTBOX: instead of case 1:... This is the fastest code to figure out for this question, but i'm not sure if it's the faster executing code out there for this specific procedure...
NeHe... I think that splitting the code so that it has the funciton prototypes in .h files and the code for those in .cpp files etc. is a very good idea. It usually allows for the same base program to be used over and over without cutnpasting, instead you could just copy the main.cpp and the others might be named as windowcommands.h, windowcommands.cpp, drawcommands.h, drawcommands.cpp... That would give you the base to a program... Then you add in other header files like texturedbox.h and texturedbox.cpp and code the box in for those... Include into your drawcommands.h and call the function/class funciton in the RenderScene() function... That's what I've been doing and it works well, especially for demos that you want to use the same base code over and over again...
S.
Edited by - Strylinys on October 1, 2000 10:15:23 AM