コード例 #1
0
    def do_configure_event(self, event):
        ClientWindow.do_configure_event(self, event)
        drawable = self.glarea.get_gl_drawable()
        context = self.glarea.get_gl_context()

        self.yuv420_shader = None

        # Re-create textures
        self.current_mode = GLClientWindow.MODE_UNINITIALIZED

        if not drawable.gl_begin(context):
            raise Exception("** Cannot create OpenGL rendering context!")

        w, h = self.get_size()
        log("Configure widget size: %d x %d" % (w, h))
        glViewport(0, 0, w, h)
        glMatrixMode(GL_PROJECTION)
        glLoadIdentity()
        glOrtho(0.0, w, h, 0.0, -1.0, 1.0)
        glMatrixMode(GL_MODELVIEW)
        glEnableClientState(GL_VERTEX_ARRAY)
        glEnableClientState(GL_TEXTURE_COORD_ARRAY)
        glDisable(GL_FRAGMENT_PROGRAM_ARB)

        if self.textures is None:
            self.textures = glGenTextures(3)

        drawable.gl_end()
コード例 #2
0
ファイル: gl_client_window.py プロジェクト: svn2github/Xpra
    def do_configure_event(self, event):
        ClientWindow.do_configure_event(self, event)
        drawable = self.glarea.get_gl_drawable()
        context = self.glarea.get_gl_context()

        self.yuv420_shader = None

        # Re-create textures
        self.current_mode = GLClientWindow.MODE_UNINITIALIZED

        if not drawable.gl_begin(context):
            raise Exception("** Cannot create OpenGL rendering context!")

        w, h = self.get_size()
        log("Configure widget size: %d x %d" % (w, h))
        glViewport(0, 0, w, h)
        glMatrixMode(GL_PROJECTION)
        glLoadIdentity()
        glOrtho(0.0, w, h, 0.0, -1.0, 1.0)
        glMatrixMode(GL_MODELVIEW)
        glEnableClientState(GL_VERTEX_ARRAY)
        glEnableClientState(GL_TEXTURE_COORD_ARRAY)
        glDisable(GL_FRAGMENT_PROGRAM_ARB)

        if self.textures is None:
            self.textures = glGenTextures(3)

        drawable.gl_end()
コード例 #3
0
 def __init__(self, client, group_leader, wid, x, y, w, h, metadata,
              override_redirect, client_properties, auto_refresh_delay):
     debug("GLClientWindow(..)")
     ClientWindow.__init__(self, client, group_leader, wid, x, y, w, h,
                           metadata, override_redirect, client_properties,
                           auto_refresh_delay)
     self.set_reallocate_redraws(True)
     self.add(self._backing.glarea)
コード例 #4
0
ファイル: gl_client_window.py プロジェクト: svn2github/Xpra
 def __init__(self, client, wid, x, y, w, h, metadata, override_redirect):
     ClientWindow.__init__(self, client, wid, x, y, w, h, metadata, override_redirect)
     display_mode = gtk.gdkgl.MODE_RGB | gtk.gdkgl.MODE_SINGLE
     self.glconfig = gtk.gdkgl.Config(mode=display_mode)
     self.glarea = gtk.gtkgl.DrawingArea(self.glconfig)
     self.glarea.set_size_request(w, h)
     self.glarea.show()
     self.add(self.glarea)
     self._on_close = []
     self.textures = None  # OpenGL texture IDs
     self.current_mode = GLClientWindow.MODE_UNINITIALIZED
コード例 #5
0
 def __init__(self, client, wid, x, y, w, h, metadata, override_redirect):
     ClientWindow.__init__(self, client, wid, x, y, w, h, metadata,
                           override_redirect)
     display_mode = (gtk.gdkgl.MODE_RGB | gtk.gdkgl.MODE_SINGLE)
     self.glconfig = gtk.gdkgl.Config(mode=display_mode)
     self.glarea = gtk.gtkgl.DrawingArea(self.glconfig)
     self.glarea.set_size_request(w, h)
     self.glarea.show()
     self.add(self.glarea)
     self._on_close = []
     self.textures = None  # OpenGL texture IDs
     self.current_mode = GLClientWindow.MODE_UNINITIALIZED
コード例 #6
0
ファイル: gl_client_window.py プロジェクト: svn2github/Xpra
 def __init__(self, client, wid, x, y, w, h, metadata, override_redirect, client_properties, auto_refresh_delay):
     ClientWindow.__init__(
         self, client, wid, x, y, w, h, metadata, override_redirect, client_properties, auto_refresh_delay
     )
     display_mode = gtk.gdkgl.MODE_RGB | gtk.gdkgl.MODE_SINGLE
     self.glconfig = gtk.gdkgl.Config(mode=display_mode)
     self.glarea = gtk.gtkgl.DrawingArea(self.glconfig)
     self.glarea.set_size_request(w, h)
     self.glarea.show()
     self.add(self.glarea)
     self._video_decoder = None
     self._video_decoder_codec = None
     self.textures = None  # OpenGL texture IDs
     self.current_mode = GLClientWindow.MODE_UNINITIALIZED
コード例 #7
0
 def __init__(self, client, wid, x, y, w, h, metadata, override_redirect,
              client_properties, auto_refresh_delay):
     ClientWindow.__init__(self, client, wid, x, y, w, h, metadata,
                           override_redirect, client_properties,
                           auto_refresh_delay)
     display_mode = (gtk.gdkgl.MODE_RGB | gtk.gdkgl.MODE_SINGLE)
     self.glconfig = gtk.gdkgl.Config(mode=display_mode)
     self.glarea = gtk.gtkgl.DrawingArea(self.glconfig)
     self.glarea.set_size_request(w, h)
     self.glarea.show()
     self.add(self.glarea)
     self._video_decoder = None
     self._video_decoder_codec = None
     self.textures = None  # OpenGL texture IDs
     self.current_mode = GLClientWindow.MODE_UNINITIALIZED
コード例 #8
0
ファイル: gl_client_window.py プロジェクト: svn2github/Xpra
 def destroy(self):
     self._backing.paint_screen = False
     ClientWindow.destroy(self)
コード例 #9
0
ファイル: gl_client_window.py プロジェクト: svn2github/Xpra
 def do_configure_event(self, event):
     debug("GL do_configure_event(%s)", event)
     ClientWindow.do_configure_event(self, event)
     self._backing.paint_screen = True
コード例 #10
0
ファイル: gl_client_window.py プロジェクト: svn2github/Xpra
 def __init__(self, client, group_leader, wid, x, y, w, h, metadata, override_redirect, client_properties, auto_refresh_delay):
     debug("GLClientWindow(..)")
     ClientWindow.__init__(self, client, group_leader, wid, x, y, w, h, metadata, override_redirect, client_properties, auto_refresh_delay)
     self.set_reallocate_redraws(True)
     self.add(self._backing.glarea)
コード例 #11
0
 def destroy(self):
     self._backing.paint_screen = False
     ClientWindow.destroy(self)
コード例 #12
0
 def do_configure_event(self, event):
     debug("GL do_configure_event(%s)", event)
     ClientWindow.do_configure_event(self, event)
     self._backing.paint_screen = True