2014-07-08 03:11:14 -04:00
|
|
|
#include "FractoriumPch.h"
|
|
|
|
#include "Fractorium.h"
|
|
|
|
#include <QtWidgets/QApplication>
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Main program entry point for Fractorium.exe.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="argc">The number of command line arguments passed</param>
|
|
|
|
/// <param name="argv">The command line arguments passed</param>
|
|
|
|
/// <returns>0 if successful, else 1.</returns>
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
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
|
Numerous fixes
0.4.0.5 Beta 07/18/2014
--User Changes
Allow for vibrancy values > 1.
Add flatten and unflatten menu items.
Automatically flatten like Apophysis does.
Add plugin and new_linear tags to Xml to be compatible with Apophysis.
--Bug Fixes
Fix blur, blur3d, bubble, cropn, cross, curl, curl3d, epispiral, ho,
julia3d, julia3dz, loonie, mirror_x, mirror_y, mirror_z, rotate_x,
sinusoidal, spherical, spherical3d, stripes.
Unique filename on final render was completely broken.
Two severe OpenCL bugs. Random seeds were biased and fusing was being
reset too often leading to results that differ from the CPU.
Subtle, but sometimes severe bug in the setup of the xaos weights.
Use properly defined epsilon by getting the value from
std::numeric_limits, rather than hard coding 1e-6 or 1e-10.
Omit incorrect usage of epsilon everywhere. It should not be
automatically added to denominators. Rather, it should only be used if
the denominator is zero.
Force final render progress bars to 100 on completion. Sometimes they
didn't seem to make it there.
Make variation name and params comparisons be case insensitive.
--Code Changes
Make ForEach and FindIf wrappers around std::for_each and std::find_if.
2014-07-19 02:33:18 -04:00
|
|
|
|
|
|
|
#ifdef ISAAC_FLAM3_DEBUG
|
|
|
|
QMessageBox::critical(QApplication::desktop(), "Error", "Fractorium cannot be run in test mode, undefine ISAAC_FLAM3_DEBUG first.");
|
|
|
|
return 1;
|
|
|
|
#endif
|
|
|
|
|
2014-07-08 03:11:14 -04:00
|
|
|
//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.
|
2014-12-11 00:50:15 -05:00
|
|
|
#ifdef WIN32
|
2014-07-08 03:11:14 -04:00
|
|
|
_putenv_s("GPU_MAX_ALLOC_PERCENT", "100");
|
2014-12-11 00:50:15 -05:00
|
|
|
#else
|
|
|
|
putenv(const_cast<char*>("GPU_MAX_ALLOC_PERCENT=100"));
|
|
|
|
#endif
|
2014-12-12 03:54:03 -05:00
|
|
|
|
|
|
|
#ifndef WIN32
|
|
|
|
a.setStyleSheet("QGroupBox { border: 1px solid gray; border-radius: 3px; margin-top: 1.1em; background-color: transparent; } \n"
|
|
|
|
"QTabBar::tab { height: 2.8ex; } \n"
|
|
|
|
"QGroupBox::title "
|
|
|
|
"{"
|
|
|
|
" background-color: transparent;"
|
|
|
|
" subcontrol-origin: margin; "
|
|
|
|
//" left: 3px; "
|
|
|
|
" subcontrol-position: top left;"
|
|
|
|
" padding: 0 3px 0 3px;"
|
|
|
|
//" padding: 2px;"
|
|
|
|
"}" );
|
|
|
|
#endif
|
|
|
|
|
2015-07-24 07:59:07 -04:00
|
|
|
int rv = -1;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2015-08-10 23:10:23 -04:00
|
|
|
//a.setStyle(QStyleFactory::create("Fusion"));
|
|
|
|
//QPalette darkPalette;
|
|
|
|
/*darkPalette.setColor(QPalette::Window, QColor(53, 53, 53));
|
|
|
|
darkPalette.setColor(QPalette::WindowText, Qt::white);
|
|
|
|
darkPalette.setColor(QPalette::Base, QColor(25, 25, 25));
|
|
|
|
darkPalette.setColor(QPalette::AlternateBase, QColor(53, 53, 53));
|
|
|
|
darkPalette.setColor(QPalette::ToolTipBase, Qt::white);
|
|
|
|
darkPalette.setColor(QPalette::ToolTipText, Qt::white);
|
|
|
|
darkPalette.setColor(QPalette::Text, Qt::white);
|
|
|
|
darkPalette.setColor(QPalette::Button, QColor(53, 53, 53));
|
|
|
|
darkPalette.setColor(QPalette::ButtonText, Qt::white);
|
|
|
|
darkPalette.setColor(QPalette::BrightText, Qt::red);
|
|
|
|
darkPalette.setColor(QPalette::Link, QColor(42, 130, 218));
|
|
|
|
|
|
|
|
darkPalette.setColor(QPalette::Highlight, QColor(42, 130, 218));
|
|
|
|
darkPalette.setColor(QPalette::HighlightedText, Qt::black);;*/
|
|
|
|
|
|
|
|
//darkPalette.setColor(QPalette::, Qt::lightGray);
|
|
|
|
//darkPalette.setColor(QPalette::Window, Qt::darkGray);
|
|
|
|
//darkPalette.setColor(QPalette::Disabled, QPalette::WindowText, Qt::red);
|
|
|
|
//darkPalette.setColor(QPalette::Disabled, QPalette::ButtonText, Qt::blue);//Works for disabled buttons, but not for disabled menus.
|
|
|
|
|
|
|
|
//a.setPalette(darkPalette);
|
|
|
|
//a.setStyleSheet("QToolTip { color: #ffffff; background-color: darkgray; border: 1px solid white; }");
|
|
|
|
//a.setStyleSheet("QTableWidget { border-color: darkgray; }")
|
|
|
|
//QString s;
|
|
|
|
|
|
|
|
//s = "QTableView, QSpinBox, QDoubleSpinBox, QGroupBox, QTreeWidget { background-color: darkGray; } ";
|
|
|
|
//s += "QComboBox, QTextEdit, QLineEdit { background - color: lightGray; } ";
|
|
|
|
//s += "QTabWidget { window-color: darkGray; } ";
|
|
|
|
//a.setStyleSheet("{ color: rgb(85, 170, 0); }");
|
|
|
|
//a.setStyleSheet("GLWidget { background-color: darkgray; }");
|
|
|
|
//a.setStyleSheet("QTableView, QDoubleSpinBox { background-color: darkgray; }");//Works!
|
|
|
|
//a.setStyleSheet(s);//Works!
|
|
|
|
//a.setStyleSheet("QTableView, QSpinBox, QDoubleSpinBox, QTreeWidget, QTreeWidgetItem { background-color: darkgray; }");//QTreeWidgetItem not needed.
|
|
|
|
//a.setStyleSheet("QTableView, DoubleSpinBox { background-color: darkgray; }");//Works!
|
|
|
|
|
2015-07-24 07:59:07 -04:00
|
|
|
Fractorium w;
|
|
|
|
w.show();
|
|
|
|
a.installEventFilter(&w);
|
|
|
|
rv = a.exec();
|
2015-08-10 23:10:23 -04:00
|
|
|
}
|
|
|
|
catch (const char* e)
|
|
|
|
{
|
2015-07-24 07:59:07 -04:00
|
|
|
QMessageBox::critical(0, "Fatal Error", e);
|
|
|
|
}
|
|
|
|
|
|
|
|
return rv;
|
2014-07-08 03:11:14 -04:00
|
|
|
}
|
2014-12-11 00:50:15 -05:00
|
|
|
|