Exemplo n.º 1
0
def _refresh(swap_buffers=1,_self=cmd):  # Only call with GLUT thread!
    # WARNING: internal routine, subject to change
    r = None
    try:
        _self.lock(_self)
        if hasattr(_self._pymol,'glutThread'):
            if thread.get_ident() == _self._pymol.glutThread:
                if swap_buffers:
                    r = _cmd.refresh_now(_self._COb)
                else:
                    r = _cmd.refresh(_self._COb)
            else:
                r = _cmd.refresh_later(_self._COb)                
        else:
            r = _cmd.refresh_later(_self._COb)
    finally:
        _self.unlock(-1,_self)
    return r
Exemplo n.º 2
0
def _refresh(swap_buffers=1,_self=cmd):  # Only call with GLUT thread!
    # WARNING: internal routine, subject to change
    r = None
    try:
        _self.lock(_self)
        if hasattr(_self._pymol,'glutThread'):
            if thread.get_ident() == _self._pymol.glutThread:
                if swap_buffers:
                    r = _cmd.refresh_now(_self._COb)
                else:
                    r = _cmd.refresh(_self._COb)
            else:
                r = _cmd.refresh_later(_self._COb)                
        else:
            r = _cmd.refresh_later(_self._COb)
    finally:
        _self.unlock(-1,_self)
    return r
Exemplo n.º 3
0
def _refresh(swap_buffers=1, _self=cmd):  # Only call with GLUT thread!
    # WARNING: internal routine, subject to change
    r = None
    try:
        _self.lock(_self)
        if _self.is_gui_thread():
            if swap_buffers:
                r = _cmd.refresh_now(_self._COb)
            else:
                r = _cmd.refresh(_self._COb)
        else:
            r = _cmd.refresh_later(_self._COb)
    finally:
        _self.unlock(-1, _self)
    return r
Exemplo n.º 4
0
def _refresh(swap_buffers=1, _self=cmd):  # Only call with GLUT thread!
    # WARNING: internal routine, subject to change
    r = None
    if _self.is_gui_thread():

        def func():
            with _self.lockcm:
                if swap_buffers:
                    r = _cmd.refresh_now(_self._COb)
                else:
                    r = _cmd.refresh(_self._COb)
                return r

        r = _self._call_with_opengl_context(func)
    else:
        with _self.lockcm:
            r = _cmd.refresh_later(_self._COb)
    return r