def __init__(self, width, height, config = None, share_group = None, **kwds): pf = GLConfig._from_args(config, kwds) GLContext.__init__(self, share_group, pf, kwds) gl_config = pf._gtk_get_config() self._gl_config = gl_config # if share: # gtk_share = share.shared_context._gtk_get_gl_context() # else: # gtk_share = None gtk_share = self._gtk_get_share() GtkPixmap.__init__(self, width, height) gdk_pixmap = self._gdk_pixmap gdkgl.ext(gdk_pixmap) self._gl_drawable = gdk_pixmap.set_gl_capability(glconfig = gl_config) print "GLPixmap: self._gl_drawable =", self._gl_drawable ### self._gl_context = gdkgl.Context( self._gl_drawable, direct = False, share_list = gtk_share, render_type = gdkgl.RGBA_TYPE ) print "GLPixmap: self._gl_context =", self._gl_context ### ImageBase.__init__(self, **kwds) self.with_context(self._init_context) print "GLPixmap: initialised context" ###
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) self.set(**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)
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)
def __init__(self, width, height, config = None, share_group = None, **kwds): print "GLPixmap:", width, height, kwds ### config = GLConfig._from_args(config, kwds) image = gdi.Bitmap(width, height) self._win_image = image graphics = gdi.Graphics.from_image(image) self._win_graphics = graphics hdc = graphics.GetHDC() self._win_hdc = hdc GLContext.__init__(self, share_group, config, hdc, 'pixmap') self._with_context(hdc, self._init_context) print "GLPixmap: done" ###
def __init__(self, width, height, config=None, share_group=None, **kwds): print("GLPixmap:", width, height, kwds) ### config = GLConfig._from_args(config, kwds) image = gdi.Bitmap(width, height) self._win_image = image graphics = gdi.Graphics.from_image(image) self._win_graphics = graphics hdc = graphics.GetHDC() self._win_hdc = hdc GLContext.__init__(self, share_group, config, hdc, 'pixmap') self._with_context(hdc, self._init_context) print("GLPixmap: done") ###
def __init__(self, width, height, config = None, share_group = None, **kwds): pf = GLConfig._from_args(config, kwds) ns_pf = pf._ns_get_pixel_format() ns_size = NSSize(width, height) ns_cache = NSCachedImageRep.alloc().initWithSize_depth_separate_alpha_( ns_size, 0, True, True) ns_image = NSImage.alloc().initWithSize_(ns_size) GLContext.__init__(self, share_group = share_group, _ns_pixel_format = ns_pf) self._ns_context.setView_(ns_cache.window().contentView()) self._init_with_ns_image(ns_image, flipped = False) self._ns_cache = ns_cache self.with_context(self._init_context)
def __init__(self, width, height, config=None, share_group=None, **kwds): pf = GLConfig._from_args(config, kwds) ns_pf = pf._ns_get_pixel_format() ns_size = NSSize(width, height) ns_cache = NSCachedImageRep.alloc().initWithSize_depth_separate_alpha_( ns_size, 0, True, True) ns_image = NSImage.alloc().initWithSize_(ns_size) GLContext.__init__(self, share_group=share_group, _ns_pixel_format=ns_pf) self._ns_context.setView_(ns_cache.window().contentView()) self._init_with_ns_image(ns_image, flipped=False) self._ns_cache = ns_cache self.with_context(self._init_context)
def __init__(self, width, height, config = None, share_group = None, **kwds): print "GLPixmap:", width, height, kwds ### config = GLConfig._from_args(config, kwds) pyhdc = gui.CreateCompatibleDC(0) dc = ui.CreateDCFromHandle(pyhdc) hdc = dc.GetSafeHdc() hbm = gui.CreateCompatibleBitmap(hdc, width, height) bm = ui.CreateBitmapFromHandle(hbm) dc.SelectObject(bm) self._win_dc = dc self._win_hbm = hbm self._win_bm = bm GLContext.__init__(self, share_group, config, hdc, 'pixmap') self._with_context(hdc, self._init_context) print "GLPixmap: done" ###
def __init__(self, width, height, config=None, share_group=None, **kwds): #print "GLPixmap:", width, height, kwds ### config = GLConfig._from_args(config, kwds) dc0 = win_none.GetDC() dc = dc0.CreateCompatibleDC(dc0) bm = ui.CreateBitmap() bm.CreateCompatibleBitmap(dc0, width, height) win_none.ReleaseDC(dc0) dc.SelectObject(bm) self._win_dc = dc self._win_bm = bm hdc = dc.GetSafeHdc() win_dump_bitmap(bm) ### GLContext.__init__(self, share_group, config, hdc, 'pixmap') self._with_context(hdc, self._init_context)
def __init__(self, width, height, config = None, share_group = None, **kwds): #print "GLPixmap:", width, height, kwds ### config = GLConfig._from_args(config, kwds) dc0 = win_none.GetDC() dc = dc0.CreateCompatibleDC(dc0) bm = ui.CreateBitmap() bm.CreateCompatibleBitmap(dc0, width, height) win_none.ReleaseDC(dc0) dc.SelectObject(bm) self._win_dc = dc self._win_bm = bm hdc = dc.GetSafeHdc() win_dump_bitmap(bm) ### GLContext.__init__(self, share_group, config, hdc, 'pixmap') self._with_context(hdc, self._init_context)
def __init__(self, width, height, config=None, share_group=None, **kwds): print "GLPixmap:", width, height, kwds ### config = GLConfig._from_args(config, kwds) pyhdc = gui.CreateCompatibleDC(0) dc = ui.CreateDCFromHandle(pyhdc) hdc = dc.GetSafeHdc() hbm = gui.CreateCompatibleBitmap(hdc, width, height) bm = ui.CreateBitmapFromHandle(hbm) dc.SelectObject(bm) self._win_dc = dc self._win_hbm = hbm self._win_bm = bm GLContext.__init__(self, share_group, config, hdc, 'pixmap') self._with_context(hdc, self._init_context) print "GLPixmap: done" ###
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)
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)
def __init__(self, width, height, config=None, share_group=None, **kwds): pf = GLConfig._from_args(config, kwds) GLContext.__init__(self, share_group, pf, kwds) gl_config = pf._gtk_get_config() self._gl_config = gl_config # if share: # gtk_share = share.shared_context._gtk_get_gl_context() # else: # gtk_share = None gtk_share = self._gtk_get_share() GtkPixmap.__init__(self, width, height) gdk_pixmap = self._gdk_pixmap gdkgl.ext(gdk_pixmap) self._gl_drawable = gdk_pixmap.set_gl_capability(glconfig=gl_config) print "GLPixmap: self._gl_drawable =", self._gl_drawable ### self._gl_context = gdkgl.Context(self._gl_drawable, direct=False, share_list=gtk_share, render_type=gdkgl.RGBA_TYPE) print "GLPixmap: self._gl_context =", self._gl_context ### ImageBase.__init__(self, **kwds) self.with_context(self._init_context) print "GLPixmap: initialised context" ###
def destroy(self): GLContext.destroy(self)
def destroy(self): GLContext.destroy(self) GGLView.destroy(self)