This commit is contained in:
2025-10-18 05:47:01 +02:00
parent e803956d75
commit be3b56856d
2 changed files with 5 additions and 4 deletions

View File

@ -17,15 +17,14 @@
from . import preview_generated from . import preview_generated
class PreviewPanel(preview_generated.PreviewPanel): class PreviewPanel(preview_generated.PreviewPanel):
__slots__ = 'canvas', 'context' __slots__ = 'video_canvas'
def __init__(self, parent, id, pos, size, style): def __init__(self, parent, id, pos, size, style):
preview_generated.PreviewPanel.__init__(self, parent, id = id, pos = pos, size = size, style = style) preview_generated.PreviewPanel.__init__(self, parent, id = id, pos = pos, size = size, style = style)
self.canvas = self._video_canvas self.video_canvas = self._video_canvas
self.context = self._video_canvas.context
def initdialog_event_handler(self, event): 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): def size_event_handler(self, event):
pass pass

View File

@ -25,3 +25,5 @@ class VideoCanvas(wx.glcanvas.GLCanvas):
wx.glcanvas.GLAttributes().PlatformDefaults().RGBA().FrameBuffersRGB().DoubleBuffer().EndList()) wx.glcanvas.GLAttributes().PlatformDefaults().RGBA().FrameBuffersRGB().DoubleBuffer().EndList())
self.context = wx.glcanvas.GLContext(self, ctxAttrs = self.context = wx.glcanvas.GLContext(self, ctxAttrs =
wx.glcanvas.GLContextAttrs().CoreProfile().OGLVersion(4,6).EndList()) wx.glcanvas.GLContextAttrs().CoreProfile().OGLVersion(4,6).EndList())
if not self.context.IsOK()):
raise RuntimeError("Failed to create GL Context")