projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9e5d71c
)
Try to fix crash on calling glGetString() without a GL context.
author
Carl Hetherington
<cth@carlh.net>
Tue, 23 Jun 2020 20:09:36 +0000
(22:09 +0200)
committer
Carl Hetherington
<cth@carlh.net>
Tue, 23 Jun 2020 20:09:36 +0000
(22:09 +0200)
src/wx/system_information_dialog.cc
patch
|
blob
|
history
diff --git
a/src/wx/system_information_dialog.cc
b/src/wx/system_information_dialog.cc
index 592e7c0ef6578f7aba113511fa44921efeade761..2d9044f6b27a950d96ad8f716379b117efaea675 100644
(file)
--- a/
src/wx/system_information_dialog.cc
+++ b/
src/wx/system_information_dialog.cc
@@
-38,27
+38,22
@@
using boost::shared_ptr;
SystemInformationDialog::SystemInformationDialog (wxWindow* parent, weak_ptr<FilmViewer> weak_viewer)
: TableDialog (parent, _("System information"), 2, 1, false)
{
SystemInformationDialog::SystemInformationDialog (wxWindow* parent, weak_ptr<FilmViewer> weak_viewer)
: TableDialog (parent, _("System information"), 2, 1, false)
{
- add (_("OpenGL version"), true);
- char const * v = (char const *) glGetString (GL_VERSION);
- if (v) {
- add (std_to_wx(v), false);
- } else {
- add (_("unknown (OpenGL not enabled in DCP-o-matic)"), false);
- }
-
-
- add (_("vsync"), true);
shared_ptr<FilmViewer> viewer = weak_viewer.lock ();
shared_ptr<FilmViewer> viewer = weak_viewer.lock ();
+ GLVideoView const * gl = viewer ? dynamic_cast<GLVideoView const *>(viewer->video_view()) : 0;
- if (!viewer) {
- add (_("unknown"), false);
+ if (!gl) {
+ add (_("OpenGL version"), true);
+ add (_("unknown (OpenGL not enabled in DCP-o-matic)"), false);
} else {
} else {
- GLVideoView const * gl = dynamic_cast<GLVideoView const *>(viewer->video_view());
- if (!gl) {
- add (_("unknown"), false);
+ add (_("OpenGL version"), true);
+ char const * v = (char const *) glGetString (GL_VERSION);
+ if (v) {
+ add (std_to_wx(v), false);
} else {
} else {
- add (
gl->vsync_enabled() ? _("enabled") : _("not enabled
"), false);
+ add (
_("unknown
"), false);
}
}
+ add (_("vsync"), true);
+ add (gl->vsync_enabled() ? _("enabled") : _("not enabled"), false);
}
layout ();
}
layout ();