gl canvas and context

This commit is contained in:
2025-10-12 03:01:18 +02:00
parent 26fbdce569
commit d8ff18387f
7 changed files with 42 additions and 102 deletions

View File

@ -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()