Exemple #1
0
 def __init__(self, config=None, share_group=None, **kwds):
     config = GLConfig._from_args(config, kwds)
     win = ui.CreateWnd()
     win.CreateWindow(None, None, win_style, win_default_rect, win_none, 0)
     dc = win.GetDC()
     hdc = dc.GetSafeHdc()
     GLContext.__init__(self, share_group, config, hdc, 'screen')
     GGLView.__init__(self, _win=win, **kwds)
     self._with_context(hdc, self._init_context)
     win.ReleaseDC(dc)
 def __init__(self, config = None, share_group = None, **kwds):
     config = GLConfig._from_args(config, kwds)
     win = ui.CreateWnd()
     win.CreateWindow(None, None, win_style, win_default_rect,
         win_none, 0)
     dc = win.GetDC()
     hdc = dc.GetSafeHdc()
     GLContext.__init__(self, share_group, config, hdc, 'screen')
     GGLView.__init__(self, _win = win, **kwds)
     self._with_context(hdc, self._init_context)
     win.ReleaseDC(dc)
Exemple #3
0
 def __init__(self, config = None, share_group = None, **kwds):
     pf = GLConfig._from_args(config, kwds)
     GLContext.__init__(self, share_group, pf, kwds)
     gtk_share = self._gtk_get_share()
     area = gtkgl.DrawingArea(glconfig = self._gl_config, share_list = gtk_share,
         render_type = gdkgl.RGBA_TYPE)
     area.show()
     self._gtk_connect_after(area, "realize", self._gtk_realize_signal)
     self._gtk_connect(area, "expose-event", self._gtk_expose_event_signal)
     GGLView.__init__(self, _gtk_outer = area, _gtk_input = area,
         _gtk_focus = area)
     self.set(**kwds)
Exemple #4
0
	def __init__(self, config = None, share_group = None, **kwds):
		pf = GLConfig._from_args(config, kwds)
		GLContext.__init__(self, share_group, pf, kwds)
		gtk_share = self._gtk_get_share()
		area = gtkgl.DrawingArea(glconfig = self._gl_config, share_list = gtk_share,
			render_type = gdkgl.RGBA_TYPE)
		area.show()
		self._gtk_connect_after(area, "realize", self._gtk_realize_signal)
		self._gtk_connect(area, "expose-event", self._gtk_expose_event_signal)
		GGLView.__init__(self, _gtk_outer = area, _gtk_input = area,
			_gtk_focus = area)
		self.set(**kwds)
Exemple #5
0
 def __init__(self, config = None, share_group = None, **kwds):
     pf = GLConfig._from_args(config, kwds)
     ns_pf = pf._ns_get_pixel_format()
     width, height = GGLView._default_size
     ns_rect = NSMakeRect(0, 0, width, height)
     ns_view = _PyGUI_NSOpenGLView.alloc().initWithFrame_pixelFormat_(
         ns_rect, ns_pf)
     ns_view.pygui_component = self
     GGLView.__init__(self, _ns_view = ns_view)
     GLContext.__init__(self, share_group = share_group, _ns_pixel_format = ns_pf)
     ns_context = self._ns_context
     ns_view.setOpenGLContext_(ns_context)
     #ns_context.setView_(ns_view) # Docs say this is needed, but
     # prints warning and seems to work without.
     if pf.double_buffer:
         self._ns_flush = ns_context.flushBuffer
     else:
         self._ns_flush = glFlush
     self.set(**kwds)
     self.with_context(self._init_context)
Exemple #6
0
 def __init__(self, config=None, share_group=None, **kwds):
     pf = GLConfig._from_args(config, kwds)
     ns_pf = pf._ns_get_pixel_format()
     width, height = GGLView._default_size
     ns_rect = NSMakeRect(0, 0, width, height)
     ns_view = _PyGUI_NSOpenGLView.alloc().initWithFrame_pixelFormat_(
         ns_rect, ns_pf)
     ns_view.pygui_component = self
     GGLView.__init__(self, _ns_view=ns_view)
     GLContext.__init__(self,
                        share_group=share_group,
                        _ns_pixel_format=ns_pf)
     ns_context = self._ns_context
     ns_view.setOpenGLContext_(ns_context)
     #ns_context.setView_(ns_view) # Docs say this is needed, but
     # prints warning and seems to work without.
     if pf.double_buffer:
         self._ns_flush = ns_context.flushBuffer
     else:
         self._ns_flush = glFlush
     self.set(**kwds)
     self.with_context(self._init_context)
Exemple #7
0
 def destroy(self):
     GLContext.destroy(self)
     GGLView.destroy(self)
Exemple #8
0
 def destroy(self):
     #print "GLView.destroy:", self ###
     ns_view = self._ns_view
     GGLView.destroy(self)
     #print "GLView.destroy: breaking back link from", ns_view ###
     ns_view.pygui_component = None
 def destroy(self):
     GLContext.destroy(self)
     GGLView.destroy(self)
Exemple #10
0
 def destroy(self):
     #print "GLView.destroy:", self ###
     ns_view = self._ns_view
     GGLView.destroy(self)
     #print "GLView.destroy: breaking back link from", ns_view ###
     ns_view.pygui_component = None