From be3b56856d4c0b5211121d0b5402cec6afe94ed4 Mon Sep 17 00:00:00 2001 From: Roz K Date: Sat, 18 Oct 2025 05:47:01 +0200 Subject: [PATCH] pyui --- pyui/preview.py | 7 +++---- pyui/video.py | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pyui/preview.py b/pyui/preview.py index eab4923..4382d89 100644 --- a/pyui/preview.py +++ b/pyui/preview.py @@ -17,15 +17,14 @@ from . import preview_generated class PreviewPanel(preview_generated.PreviewPanel): - __slots__ = 'canvas', 'context' + __slots__ = 'video_canvas' def __init__(self, parent, id, pos, size, style): preview_generated.PreviewPanel.__init__(self, parent, id = id, pos = pos, size = size, style = style) - self.canvas = self._video_canvas - self.context = self._video_canvas.context + self.video_canvas = self._video_canvas def initdialog_event_handler(self, event): - self.canvas.SetCurrent(self.context) + self.video_canvas.SetCurrent(self.video_canvas.context) def size_event_handler(self, event): pass diff --git a/pyui/video.py b/pyui/video.py index 3cba989..f551949 100644 --- a/pyui/video.py +++ b/pyui/video.py @@ -25,3 +25,5 @@ class VideoCanvas(wx.glcanvas.GLCanvas): wx.glcanvas.GLAttributes().PlatformDefaults().RGBA().FrameBuffersRGB().DoubleBuffer().EndList()) self.context = wx.glcanvas.GLContext(self, ctxAttrs = wx.glcanvas.GLContextAttrs().CoreProfile().OGLVersion(4,6).EndList()) + if not self.context.IsOK()): + raise RuntimeError("Failed to create GL Context")