mirror of
https://github.com/YACReader/yacreader
synced 2026-03-01 10:22:58 -05:00
Remove software and opengl flow implementations
This simplifies the code base A LOT.
This commit is contained in:
@ -21,7 +21,6 @@
|
||||
#include "db_helper.h"
|
||||
#include "yacreader_libraries.h"
|
||||
#include "exit_check.h"
|
||||
#include "opengl_checker.h"
|
||||
#ifdef Q_OS_MACOS
|
||||
#include "trayhandler.h"
|
||||
#endif
|
||||
@ -77,19 +76,6 @@ void logSystemAndConfig()
|
||||
else
|
||||
QLOG_INFO() << "server : disabled";
|
||||
|
||||
if (settings.value(USE_OPEN_GL).toBool())
|
||||
QLOG_INFO() << "OpenGL : enabled"
|
||||
<< " - " << (settings.value(V_SYNC).toBool() ? "VSync on" : "VSync off");
|
||||
else
|
||||
QLOG_INFO() << "OpenGL : disabled";
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) && defined(YACREADER_USE_RHI)
|
||||
QLOG_INFO() << "Using RHI (Qt Rendering Hardware Interface) - graphics backend will be auto-selected";
|
||||
#else
|
||||
OpenGLChecker checker;
|
||||
QLOG_INFO() << "OpenGL version : " << checker.textVersionDescription();
|
||||
#endif
|
||||
|
||||
auto libraries = DBHelper::getLibraries().getLibraries();
|
||||
QLOG_INFO() << "Libraries: ";
|
||||
for (auto library : libraries) {
|
||||
@ -199,32 +185,8 @@ int main(int argc, char **argv)
|
||||
parser.addHelpOption();
|
||||
parser.addVersionOption();
|
||||
parser.addOption({ "loglevel", "Set log level. Valid values: trace, info, debug, warn, error.", "loglevel", "warning" });
|
||||
#ifdef Q_OS_WIN
|
||||
parser.addOption({ "opengl", "Set opengl renderer. Valid values: desktop, es, software.", "gl_renderer" });
|
||||
#endif
|
||||
parser.process(app);
|
||||
|
||||
// When using RHI (Qt 6.7+), don't allow OpenGL attribute overrides
|
||||
#if !defined(YACREADER_USE_RHI) || QT_VERSION < QT_VERSION_CHECK(6, 7, 0)
|
||||
#ifdef Q_OS_WIN
|
||||
if (parser.isSet("opengl")) {
|
||||
QTextStream qout(stdout);
|
||||
if (parser.value("opengl") == "desktop") {
|
||||
app.setAttribute(Qt::AA_UseDesktopOpenGL);
|
||||
} else if (parser.value("opengl") == "es") {
|
||||
app.setAttribute(Qt::AA_UseOpenGLES);
|
||||
} else if (parser.value("opengl") == "software") {
|
||||
qout << "Warning! This will be slow as hell. Only use this setting for"
|
||||
"testing or as a last resort.";
|
||||
app.setAttribute(Qt::AA_UseSoftwareOpenGL);
|
||||
} else {
|
||||
qout << "Invalid value:" << parser.value("gl_renderer");
|
||||
parser.showHelp();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (parser.isSet("loglevel")) {
|
||||
if (parser.value("loglevel") == "trace") {
|
||||
logger.setLoggingLevel(QsLogging::TraceLevel);
|
||||
|
||||
Reference in New Issue
Block a user