def _set_window(self, window): assert self._context is None _gdi32.SetPixelFormat(window._dc, self.config._pf, None) self._context = wgl.wglCreateContext(window._dc) if self._share: assert self._share._context is not None wgl.wglShareLists(self._share._context, self._context)
def _set_window(self, window): assert self._context is None _gdi32.SetPixelFormat(window._dc, self.config._pf, None) self._context = wgl.wglCreateContext(window._dc) if self._share: assert self._share._context is not None if not wgl.wglShareLists(self._share._context, self._context): raise gl.ContextException('Unable to share contexts')
def attach(self, canvas): super(Win32Context, self).attach(canvas) if not self._context: self.config._set_pixel_format(canvas) self._context = wgl.wglCreateContext(canvas.hdc) share = self.context_share if share: if not share.canvas: raise RuntimeError('Share context has no canvas.') if not wgl.wglShareLists(share._context, self._context): raise gl.ContextException('Unable to share contexts.')
def attach(self, canvas): super(Win32Context, self).attach(canvas) if not self._context: if self.config._requires_gl_3(): raise gl.ContextException("Require WGL_ARB_create_context extension to create " + "OpenGL 3 contexts.") self.config._set_pixel_format(canvas) self._context = wgl.wglCreateContext(canvas.hdc) share = self.context_share if share: if not share.canvas: raise RuntimeError("Share context has no canvas.") if not wgl.wglShareLists(share._context, self._context): raise gl.ContextException("Unable to share contexts")
def attach(self, canvas): if self.config._requires_gl_3(): raise gl.ContextException( 'Require WGL_ARB_create_context extension to create ' + 'OpenGL 3 contexts.') super(Win32Context, self).attach(canvas) self.config._set_pixel_format(canvas) self._context = wgl.wglCreateContext(canvas.hdc) share = self.context_share if share: if not share.canvas: raise RuntimeError('Share context has no canvas.') if not wgl.wglShareLists(share._context, self._context): raise gl.ContextException('Unable to share contexts')