#include "FractoriumPch.h" #include "Fractorium.h" #include /// /// Main program entry point for Fractorium.exe. /// /// The number of command line arguments passed /// The command line arguments passed /// 0 if successful, else 1. int main(int argc, char* argv[]) { int rv = -1; QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication a(argc, argv); #ifdef TEST_CL QMessageBox::critical(QApplication::desktop(), "Error", "Fractorium cannot be run in test mode, undefine TEST_CL first."); return 1; #endif #ifdef ISAAC_FLAM3_DEBUG QMessageBox::critical(QApplication::desktop(), "Error", "Fractorium cannot be run in test mode, undefine ISAAC_FLAM3_DEBUG first."); return 1; #endif _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON); auto vf = VarFuncs::Instance();//Create instances that will stay alive until the program exits. auto vlf = VariationList::Instance(); auto palf = PaletteList::Instance(); auto settings = FractoriumSettings::Instance(); #ifdef DO_DOUBLE auto vd = VarFuncs::Instance(); auto vld = VariationList::Instance();//No further creations should occur after this. #endif try { //Required for large allocs, else GPU memory usage will be severely limited to small sizes. //This must be done in the application and not in the EmberCL DLL. #ifdef _WIN32 _putenv_s("GPU_MAX_ALLOC_PERCENT", "100"); #else putenv(const_cast("GPU_MAX_ALLOC_PERCENT=100")); #endif //auto qsf = QSurfaceFormat::defaultFormat(); //qDebug() << "Version: " << qsf.majorVersion() << ',' << qsf.minorVersion(); //qDebug() << "Profile: " << qsf.profile(); //qDebug() << "Depth buffer size: " << qsf.depthBufferSize(); //qDebug() << "Swap behavior: " << qsf.swapBehavior(); //qDebug() << "Swap interval: " << qsf.swapInterval(); //qsf.setDepthBufferSize(24); //qsf.setSwapInterval(1);//Vsync. //qsf.setSwapBehavior(QSurfaceFormat::DoubleBuffer); #ifndef USE_GLSL qsf.setVersion(2, 0); qsf.setProfile(QSurfaceFormat::CompatibilityProfile); #else //qsf.setVersion(4, 5); //qsf.setRenderableType(QSurfaceFormat::OpenGL); //qsf.setProfile(QSurfaceFormat::CoreProfile); #endif //QSurfaceFormat::setDefaultFormat(qsf); Fractorium w; w.show(); a.installEventFilter(&w); rv = a.exec(); } catch (const std::exception& e) { QMessageBox::critical(nullptr, "Fatal Error", QString::fromStdString(e.what())); } catch (const char* e) { QMessageBox::critical(nullptr, "Fatal Error", e); } return rv; }