- document.write('////////////////////////////////////////////////////////////////////////////////');
- document.write('//');
- document.write('// GLUT project wizard');
- document.write('//');
- document.write('////////////////////////////////////////////////////////////////////////////////');
- document.write('');
- document.write('// globals');
- document.write('GlutPathDefault <- _T("$(#glut)");');
- document.write('GlutPathDefaultInc <- _T("$(#glut.include)");');
- document.write('GlutPathDefaultLib <- _T("$(#glut.lib)");');
- document.write('GlutPath <- _T("");');
- document.write('');
- document.write('function BeginWizard()');
- document.write('{');
- document.write(' local intro_msg = _T("Welcome to the new GLUT project wizard!\\n\\n" +');
- document.write(' "This wizard will guide you to create a new project\\n" +');
- document.write(' "using the GLUT OpenGL extensions.\\n\\n" +');
- document.write(' "When you \'re ready to proceed, please click \\"Next\\"...");');
- document.write('');
- document.write(' local glutpath_descr = _T("Please select the location of GLUT on your computer.\\n" +');
- document.write(' "This is the top-level folder where GLUT was installed (unpacked).\\n" +');
- document.write(' "To help you, this folder must contain the subfolders\\n" +');
- document.write(' "\\"include\\" and \\"lib\\".");');
- document.write('');
- document.write(' Wizard.AddInfoPage(_T("GlutIntro"), intro_msg);');
- document.write(' Wizard.AddProjectPathPage();');
- document.write(' if (PLATFORM == PLATFORM_MAC)');
- document.write(' {');
- document.write(' GlutPathDefault="/System/Library/Frameworks/GLUT.framework";');
- document.write(' }');
- document.write(' else');
- document.write(' Wizard.AddGenericSelectPathPage(_T("GlutPath"), glutpath_descr, _T("Please select GLUT\'s location:"), GlutPathDefault);');
- document.write(' Wizard.AddCompilerPage(_T(""), _T("*"), true, true);');
- document.write('}');
- document.write('');
- document.write('////////////////////////////////////////////////////////////////////////////////');
- document.write('// GLUT\'s path page');
- document.write('////////////////////////////////////////////////////////////////////////////////');
- document.write('');
- document.write('function OnLeave_GlutPath(fwd)');
- document.write('{');
- document.write(' if (fwd)');
- document.write(' {');
- document.write(' local dir = Wizard.GetTextControlValue(_T("txtFolder")); // txtFolder is the text control in GenericSelectPathPage');
- document.write(' local dir_nomacro = VerifyDirectory(dir);');
- document.write('');
- document.write(' if (dir_nomacro.IsEmpty())');
- document.write(' return false;');
- document.write('');
- document.write(' // verify include dependencies');
- document.write(' local dir_nomacro_inc = GetCompilerIncludeDir(dir, GlutPathDefault, GlutPathDefaultInc);');
- document.write(' if (dir_nomacro_inc.IsEmpty())');
- document.write(' return false;');
- document.write(' if (!VerifyFile(dir_nomacro_inc + wxFILE_SEP_PATH + _T("GL"), _T("glut.h"), _T("GLUT\'s include"))) return false;');
- document.write('');
- document.write(' // verify library dependencies');
- document.write(' local dir_nomacro_lib = GetCompilerLibDir(dir, GlutPathDefault, GlutPathDefaultLib);');
- document.write(' if (dir_nomacro_lib.IsEmpty())');
- document.write(' return false;');
- document.write('');
- document.write(' if (PLATFORM == PLATFORM_MSW)');
- document.write(' {');
- document.write(' if (!VerifyLibFile(dir_nomacro_lib, _T("glut32"), _T("GLUT\'s"))) return false;');
- document.write(' }');
- document.write(' else');
- document.write(' {');
- document.write(' if (!VerifyLibFile(dir_nomacro_lib, _T("glut"), _T("GLUT\'s"))) return false;');
- document.write(' }');
- document.write('');
- document.write('');
- document.write(' GlutPath = dir; // Remember the original selection.');
- document.write('');
- document.write(' local is_macro = _T("");');
- document.write('');
- document.write(' // try to resolve the include directory as macro');
- document.write(' is_macro = GetCompilerIncludeMacro(dir, GlutPathDefault, GlutPathDefaultInc);');
- document.write(' if (is_macro.IsEmpty())');
- document.write(' {');
- document.write(' // not possible -> use the real inc path we had computed instead');
- document.write(' GlutPathDefaultInc = dir_nomacro_inc;');
- document.write(' }');
- document.write('');
- document.write(' // try to resolve the library directory as macro');
- document.write(' is_macro = GetCompilerLibMacro(dir, GlutPathDefault, GlutPathDefaultLib);');
- document.write(' if (is_macro.IsEmpty())');
- document.write(' {');
- document.write(' // not possible -> use the real lib path we had computed instead');
- document.write(' GlutPathDefaultLib = dir_nomacro_lib;');
- document.write(' }');
- document.write(' }');
- document.write(' return true;');
- document.write('}');
- document.write('');
- document.write('// return the files this project contains');
- document.write('function GetFilesDir()');
- document.write('{');
- document.write(' return _T("glut/files");');
- document.write('}');
- document.write('');
- document.write('// setup the already created project');
- document.write('function SetupProject(project)');
- document.write('{');
- document.write(' // set project options');
- document.write(' if (PLATFORM != PLATFORM_MAC)');
- document.write(' {');
- document.write(' project.AddIncludeDir(GlutPathDefaultInc);');
- document.write(' project.AddLibDir(GlutPathDefaultLib);');
- document.write(' }');
- document.write('');
- document.write(' // add link libraries');
- document.write(' if (PLATFORM == PLATFORM_MSW)');
- document.write(' {');
- document.write(' project.AddLinkLib(_T("freeglut"));');
- document.write(' project.AddLinkLib(_T("opengl32"));');
- document.write(' project.AddLinkLib(_T("glu32"));');
- document.write(' project.AddLinkLib(_T("winmm"));');
- document.write(' project.AddLinkLib(_T("gdi32"));');
- document.write(' }');
- document.write(' else if (PLATFORM == PLATFORM_MAC)');
- document.write(' {');
- document.write(' project.AddLinkerOption(_T("-framework GLUT"));');
- document.write(' project.AddLinkerOption(_T("-framework OpenGL"));');
- document.write('');
- document.write(' project.AddLinkerOption(_T("-framework Cocoa")); // GLUT dependency');
- document.write(' }');
- document.write(' else');
- document.write(' {');
- document.write(' project.AddLinkLib(_T("glut"));');
- document.write(' project.AddLinkLib(_T("GL"));');
- document.write(' project.AddLinkLib(_T("GLU"));');
- document.write(' project.AddLinkLib(_T("Xxf86vm"));');
- document.write(' }');
- document.write('');
- document.write(' // enable compiler warnings (project-wide)');
- document.write(' WarningsOn(project, Wizard.GetCompilerID());');
- document.write('');
- document.write(' // Debug');
- document.write(' local target = project.GetBuildTarget(Wizard.GetDebugName());');
- document.write(' if (!IsNull(target))');
- document.write(' {');
- document.write(' target.SetTargetType(ttConsoleOnly); // ttConsoleOnly: console for debugging');
- document.write(' target.SetOutputFilename(Wizard.GetDebugOutputDir() + Wizard.GetProjectName() + DOT_EXT_EXECUTABLE);');
- document.write(' target.SetWorkingDir(GlutPath + _T("/bin"));');
- document.write(' // enable generation of debugging symbols for target');
- document.write(' DebugSymbolsOn(target, Wizard.GetCompilerID());');
- document.write(' }');
- document.write('');
- document.write(' // Release');
- document.write(' target = project.GetBuildTarget(Wizard.GetReleaseName());');
- document.write(' if (!IsNull(target))');
- document.write(' {');
- document.write(' target.SetTargetType(ttExecutable); // ttExecutable: no console');
- document.write(' target.SetOutputFilename(Wizard.GetReleaseOutputDir() + Wizard.GetProjectName() + DOT_EXT_EXECUTABLE);');
- document.write(' target.SetWorkingDir(GlutPath + _T("/bin"));');
- document.write(' // enable optimizations for target');
- document.write(' OptimizationsOn(target, Wizard.GetCompilerID());');
- document.write(' }');
- document.write('');
- document.write(' return true;');
- document.write('}');
- document.write('');
[text] wizard.script
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new: