예제 #1
0
파일: texture.py 프로젝트: mabl/glumpy
    def _update(self):

        log.debug("GPU: Updating texture")
        if self.pending_data:
            x,width = self.pending_data
            itemsize = self.strides[0]
            x /= itemsize
            width /= itemsize
            gl.glTexSubImage1D(self.target, 0, x, width, self.format, self.gtype, self)
        self._pending_data = None
        self._need_update = False
예제 #2
0
    def _update(self):

        log.debug("GPU: Updating texture")
        if self.pending_data:
            start, stop = self.pending_data
            offset, nbytes = start, stop-start
            itemsize = self.strides[0]
            x = offset // itemsize
            width = nbytes//itemsize
            gl.glTexSubImage1D(self.target, 0, x, width, self._cpu_format, self.gtype, self)

            # x,width = self.pending_data
            # itemsize = self.strides[0]
            # x /= itemsize
            # width /= itemsize
            # gl.glTexSubImage1D(self.target, 0, x, width, self._cpu_format, self.gtype, self)
        self._pending_data = None
        self._need_update = False
예제 #3
0
    def _update(self):

        log.debug("GPU: Updating texture")
        if self.pending_data:
            start, stop = self.pending_data
            offset, nbytes = start, stop-start
            itemsize = self.strides[0]
            x = offset / itemsize
            width = nbytes/itemsize
            gl.glTexSubImage1D(self.target, 0, x, width, self._cpu_format, self.gtype, self)

            # x,width = self.pending_data
            # itemsize = self.strides[0]
            # x /= itemsize
            # width /= itemsize
            # gl.glTexSubImage1D(self.target, 0, x, width, self._cpu_format, self.gtype, self)
        self._pending_data = None
        self._need_update = False