VulkanExampleBase::VulkanExampleBase(bool enableValidation) { // Check for validation command line flag #if defined(_WIN32) for (int32_t i = 0; i < __argc; i++) { if (__argv[i] == std::string("-validation")) { enableValidation = true; } } #elif defined(__ANDROID__) // Vulkan library is loaded dynamically on Android bool libLoaded = loadVulkanLibrary(); assert(libLoaded); #elif defined(__linux__) initxcbConnection(); #endif #if !defined(__ANDROID__) // Android Vulkan initialization is handled in APP_CMD_INIT_WINDOW event initVulkan(enableValidation); #endif #if defined(_WIN32) // Enable console if validation is active // Debug message callback will output to it if (enableValidation) { setupConsole("VulkanExample"); } #endif }
VulkanBase::VulkanBase(bool enableValidation) { for (int32_t i = 0; i < __argc; i++) if (__argv[i] == std::string("-validation")) enableValidation = true; initVulkan(enableValidation); if (enableValidation) setupConsole("VulkanTerrain"); }
VulkanExample() : VulkanExampleBase(ENABLE_VALIDATION) { width = 1280; height = 720; zoom = -35.0f; zoomSpeed = 2.5f; rotationSpeed = 0.5f; rotation = { 0.0, -123.75, 0.0 }; title = "Vulkan Example - Occlusion queries"; #ifdef _WIN32 if (!ENABLE_VALIDATION) { setupConsole(title); } #endif }
int main(int argc, char** argv) { #ifdef PLATFORM_MAC void* pool = UpdateDialogCocoa::createAutoreleasePool(); #endif Log::instance()->open(AppInfo::logFilePath()); #ifdef PLATFORM_MAC // when the updater is run for the first time, create a Mac app bundle // and re-launch the application from the bundle. This permits // setting up bundle properties (such as application icon) if (unpackBundle(argc,argv)) { return 0; } #endif UpdaterOptions options; options.parse(argc,argv); if (options.showVersion) { setupConsole(); std::cout << "Update installer version " << UPDATER_VERSION << std::endl; return 0; } UpdateInstaller installer; UpdateScript script; if (!options.scriptPath.empty()) { script.parse(FileUtils::makeAbsolute(options.scriptPath.c_str(),options.packageDir.c_str())); } LOG(Info,"started updater. install-dir: " + options.installDir + ", package-dir: " + options.packageDir + ", wait-pid: " + intToStr(options.waitPid) + ", script-path: " + options.scriptPath + ", mode: " + intToStr(options.mode) + ", finish-cmd: " + options.finishCmd + ", finish-dir: " + options.finishDir); installer.setMode(options.mode); installer.setInstallDir(options.installDir); installer.setPackageDir(options.packageDir); installer.setScript(&script); installer.setWaitPid(options.waitPid); installer.setForceElevated(options.forceElevated); installer.setAutoClose(options.autoClose); installer.setFinishCmd(options.finishCmd); installer.setFinishDir(options.finishDir); installer.setDryRun(options.dryRun); if (options.mode == UpdateInstaller::Main) { LOG(Info, "Showing updater UI - auto close? " + intToStr(options.autoClose)); std::auto_ptr<UpdateDialog> dialog(createUpdateDialog()); dialog->setAutoClose(options.autoClose); dialog->init(argc, argv); installer.setObserver(dialog.get()); std::thread updaterThread(runUpdaterThread, &installer); dialog->exec(); updaterThread.join(); } else { installer.run(); } #ifdef PLATFORM_MAC UpdateDialogCocoa::releaseAutoreleasePool(pool); #endif return 0; }
void Console::SetupConsole(CComPtr<IMgaProject> project) { setupConsole(project); }