wxPython GUI and PyOpenGL - 03 - creating the Canvas

preview_player
Показать описание
Let's create the canvas, where we can draw with OpenGL.
Рекомендации по теме
Комментарии
Автор

I have errors with X Window, working sample:

## OpenGL canvas
## @ingroup gl
class
## create GL canvas
def __init__(self, parent):
wx.glcanvas.GLCanvas.__init__(self, parent, wx.ID_ANY, size=(64, 32))
## OpenGL context
self.context = wx.glcanvas.GLContext(self)
# bind paint event to drawer
self.Bind(wx.EVT_PAINT, self.OnDraw)
## process GL draw event
def OnDraw(self, e):
self.SetCurrent(self.context)
glClearColor(.1, .2, .3, 1)
glClear(GL_COLOR_BUFFER_BIT)
self.SwapBuffers()

dmitryponyatov
Автор

can you do a tutorial on how to do this in pyqt5?

Art-Montilla
visit shbcf.ru