leocad/common/lc_aboutdialog.cpp

48 lines
2.4 KiB
C++
Raw Normal View History

2013-08-09 06:57:18 +02:00
#include "lc_global.h"
2023-04-30 04:55:54 +02:00
#include "lc_aboutdialog.h"
#include "ui_lc_aboutdialog.h"
#include "lc_mainwindow.h"
2020-12-25 19:43:22 +01:00
#include "lc_view.h"
2015-05-09 21:54:29 +02:00
#include "lc_glextensions.h"
2020-12-27 22:05:55 +01:00
#include "lc_viewwidget.h"
2013-08-09 06:57:18 +02:00
2023-04-30 04:55:54 +02:00
lcAboutDialog::lcAboutDialog(QWidget* Parent)
: QDialog(Parent), ui(new Ui::lcAboutDialog)
2013-08-09 06:57:18 +02:00
{
ui->setupUi(this);
#ifdef LC_CONTINUOUS_BUILD
ui->version->setText(tr("LeoCAD Continuous Build %1").arg(QString::fromLatin1(QT_STRINGIFY(LC_CONTINUOUS_BUILD))));
#else
ui->version->setText(tr("LeoCAD Version %1").arg(QString::fromLatin1(LC_VERSION_TEXT)));
#endif
2013-08-09 06:57:18 +02:00
2020-12-27 22:05:55 +01:00
lcViewWidget* Widget = gMainWindow->GetActiveView()->GetWidget();
QSurfaceFormat Format = Widget->context()->format();
2017-04-27 07:24:54 +02:00
int ColorDepth = Format.redBufferSize() + Format.greenBufferSize() + Format.blueBufferSize() + Format.alphaBufferSize();
2020-12-27 22:05:55 +01:00
const QString QtVersionFormat = tr("Qt Version %1 (compiled with %2)\n\n");
const QString QtVersion = QtVersionFormat.arg(qVersion(), QT_VERSION_STR);
const QString VersionFormat = tr("OpenGL Version %1 (GLSL %2)\n%3 - %4\n\n");
const QString Version = VersionFormat.arg(QString((const char*)glGetString(GL_VERSION)), QString((const char*)glGetString(GL_SHADING_LANGUAGE_VERSION)), QString((const char*)glGetString(GL_RENDERER)), QString((const char*)glGetString(GL_VENDOR)));
const QString BuffersFormat = tr("Color Buffer: %1 bits\nDepth Buffer: %2 bits\nStencil Buffer: %3 bits\n\n");
const QString Buffers = BuffersFormat.arg(QString::number(ColorDepth), QString::number(Format.depthBufferSize()), QString::number(Format.stencilBufferSize()));
2021-01-10 03:01:03 +01:00
const QString ExtensionsFormat = tr("Buffers: %1\nShaders: %2\nFramebuffers: %3\nBlendFuncSeparate: %4\nAnisotropic: %5\n");
2021-01-03 20:57:26 +01:00
const QString VertexBuffers = gSupportsVertexBufferObject ? tr("Supported") : tr("Not supported");
const QString Shaders = gSupportsShaderObjects ? tr("Supported") : tr("Not supported");
const QString Framebuffers = gSupportsFramebufferObject ? tr("Supported") : tr("Not supported");
const QString BlendFuncSeparate = gSupportsBlendFuncSeparate ? tr("Supported") : tr("Not supported");
const QString Anisotropic = gSupportsAnisotropic ? tr("Supported (max %1)").arg(gMaxAnisotropy) : tr("Not supported");
2021-01-10 03:01:03 +01:00
const QString Extensions = ExtensionsFormat.arg(VertexBuffers, Shaders, Framebuffers, BlendFuncSeparate, Anisotropic);
ui->info->setText(QtVersion + Version + Buffers + Extensions);
2013-08-09 06:57:18 +02:00
}
2023-04-30 04:55:54 +02:00
lcAboutDialog::~lcAboutDialog()
2013-08-09 06:57:18 +02:00
{
delete ui;
}