pyui
This commit is contained in:
		@ -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
 | 
			
		||||
 | 
			
		||||
@ -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")
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user