leocad/qt/lc_qaboutdialog.cpp

41 lines
2.3 KiB
C++
Raw Normal View History

2013-08-09 06:57:18 +02:00
#include "lc_global.h"
#include "lc_qaboutdialog.h"
#include "ui_lc_qaboutdialog.h"
#include "lc_mainwindow.h"
2016-12-28 22:30:31 +01:00
#include "view.h"
2015-05-09 21:54:29 +02:00
#include "lc_glextensions.h"
2013-08-09 06:57:18 +02:00
2016-02-17 00:11:52 +01:00
lcQAboutDialog::lcQAboutDialog(QWidget *parent) :
2013-08-09 06:57:18 +02:00
QDialog(parent),
ui(new Ui::lcQAboutDialog)
{
ui->setupUi(this);
ui->version->setText(tr("LeoCAD Version %1").arg(QString::fromLatin1(LC_VERSION_TEXT)));
2013-08-09 06:57:18 +02:00
2017-04-27 07:24:54 +02:00
QGLWidget* Widget = (QGLWidget*)gMainWindow->GetActiveView()->mWidget;
QGLFormat Format = Widget->context()->format();
int ColorDepth = Format.redBufferSize() + Format.greenBufferSize() + Format.blueBufferSize() + Format.alphaBufferSize();
2016-02-01 23:57:51 +01:00
QString VersionFormat = tr("OpenGL Version %1 (GLSL %2)\n%3 - %4\n\n");
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)));
QString BuffersFormat = tr("Color Buffer: %1 bits %2 %3\nDepth Buffer: %4 bits\nStencil Buffer: %5 bits\n\n");
2017-04-27 07:24:54 +02:00
QString Buffers = BuffersFormat.arg(QString::number(ColorDepth), Format.rgba() ? "RGBA" : tr("indexed"), Format.doubleBuffer() ? tr("double buffered") : QString(), QString::number(Format.depthBufferSize()), QString::number(Format.stencilBufferSize()));
QString ExtensionsFormat = tr("GL_ARB_vertex_buffer_object extension: %1\nGL_ARB_framebuffer_object extension: %2\nGL_EXT_framebuffer_object extension: %3\nGL_EXT_blend_func_separate: %4\nGL_EXT_texture_filter_anisotropic extension: %5\n");
2015-05-09 21:54:29 +02:00
QString VertexBufferObject = gSupportsVertexBufferObject ? tr("Supported") : tr("Not supported");
QString FramebufferObjectARB = gSupportsFramebufferObjectARB ? tr("Supported") : tr("Not supported");
QString FramebufferObjectEXT = gSupportsFramebufferObjectEXT ? tr("Supported") : tr("Not supported");
QString BlendFuncSeparateEXT = gSupportsBlendFuncSeparate ? tr("Supported") : tr("Not supported");
2015-05-09 21:54:29 +02:00
QString Anisotropic = gSupportsAnisotropic ? tr("Supported (max %1)").arg(gMaxAnisotropy) : tr("Not supported");
QString Extensions = ExtensionsFormat.arg(VertexBufferObject, FramebufferObjectARB, FramebufferObjectEXT, BlendFuncSeparateEXT, Anisotropic);
ui->info->setText(Version + Buffers + Extensions);
2013-08-09 06:57:18 +02:00
}
lcQAboutDialog::~lcQAboutDialog()
{
delete ui;
}