2 Copyright (C) 2019-2021 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
22 #include "film_viewer.h"
23 #include "gl_video_view.h"
24 #include "system_information_dialog.h"
26 #include "wx_variant.h"
30 #include <OpenGL/glu.h>
31 #include <OpenGL/glext.h>
40 using std::shared_ptr;
43 #if wxCHECK_VERSION(3, 1, 0)
45 SystemInformationDialog::SystemInformationDialog(wxWindow* parent, FilmViewer const& viewer)
46 : TableDialog (parent, _("System information"), 2, 1, false)
48 auto gl = std::dynamic_pointer_cast<const GLVideoView>(viewer.video_view());
51 add (_("OpenGL version"), true);
52 add(variant::wx::insert_dcpomatic(_("unknown (OpenGL not enabled in %s)")), false);
54 auto information = gl->information();
55 auto add_string = [this, &information](GLenum name, wxString label) {
57 auto i = information.find(name);
58 if (i != information.end()) {
59 add (std_to_wx(i->second), false);
61 add (_("unknown"), false);
65 add_string (GL_VENDOR, _("Vendor"));
66 add_string (GL_RENDERER, _("Renderer"));
67 add_string (GL_VERSION, _("Version"));
68 add_string (GL_SHADING_LANGUAGE_VERSION, _("Shading language version"));
70 add (_("vsync"), true);
71 add (gl->vsync_enabled() ? _("enabled") : _("not enabled"), false);
79 SystemInformationDialog::SystemInformationDialog(wxWindow* parent, FilmViewer const&)
80 : TableDialog (parent, _("System information"), 2, 1, false)
82 add (_("OpenGL version"), true);
83 add(variant::wx::insert_dcpomatic(_("OpenGL renderer not supported by this %s version")), false);