Original Post
I'm not actually interested in trying this out at the moment. The idea just happened to pop in my head while I was taking a shower last night. For whatever reason input/output code popped in my head and I suddenly thought, would it be possible to make a program that's simple a menu giving certain options and, based on the options chosen, spits out code into a .cpp file then has a compiler compile the resulting file into something useable? Psuedo-Code Example: Naturally this would be usefull to the people who have no idea how to program but have an idea they want to see come to life. All they'd have to do is run this program, fill out the appropiate options in the menu to build the game engine, fill out the submenu for adding in game content, then let the program compile and execute. This would also be good for somebody that wants to build a "custom" engine and doesn't want to put time in to building one from scratch. They could use this to build a template and then go in to tweak settings to their needs. I'm interested in knowing if anybody/company has gone and done something like this yet and if not, why?
#all of the usual headers/includes and whatnot
menu_create(whatever){
if(dependency is running){
create_menu_list();
}
else{
start_dependencies();
}
}
menu_run(){
if(menu_created){
check_for_input;
}
else{
menu_create();
}
//run cases for menu options
switch(variable){
case option1:
if(code dependecies met){
output_text("output_file.cpp", "the code to write to output_file.cpp. Example,
if(world_geometry_built){
start_lighting_process();
else{
build_world_geometry();
}")
else{
create_option1_dependecies();
}
break;
case option2:
//etc........
}
}
main(){
all_of_the_usual_system_stuff;
menu_run();
onQuit(); //stop the menu and remove from memory then kill the application. You know, the usual stuff
}