gl canvas and context
This commit is contained in:
		@ -14,7 +14,19 @@
 | 
			
		||||
# You should have received a copy of the GNU General Public License along with People's Video Editor.
 | 
			
		||||
# If not, see <https://www.gnu.org/licenses/>.
 | 
			
		||||
 | 
			
		||||
from . import video_generated
 | 
			
		||||
import wx
 | 
			
		||||
import wx.glcanvas
 | 
			
		||||
 | 
			
		||||
class VideoPanel(video_generated.VideoPanel):
 | 
			
		||||
    pass
 | 
			
		||||
class VideoCanvas(wx.glcanvas.GLCanvas):
 | 
			
		||||
    __slots__ = 'context'
 | 
			
		||||
 | 
			
		||||
    def __init__(self, parent,
 | 
			
		||||
            id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.TAB_TRAVERSAL):
 | 
			
		||||
        wx.glcanvas.GLCanvas.__init__(self, parent, id = id, pos = pos, size = size, style = style, attribList =
 | 
			
		||||
            wx.glcanvas.GLAttributes().PlatformDefaults().RGBA().FrameBuffersRGB().DoubleBuffer().EndList())
 | 
			
		||||
        self.context = wx.glcanvas.GLContext(self, ctxAttrs =
 | 
			
		||||
            wx.glcanvas.GLContextAttrs().CoreProfile().OGLVersion(4,6).EndList())
 | 
			
		||||
 | 
			
		||||
    def initialize(self):
 | 
			
		||||
        self.SetCurrent(self.context)
 | 
			
		||||
        self.SwapBuffers()
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user