Example #1
0
def start(Widget):
    app = Application()
    widget = Widget(None)
    widget.show()
    app.startTimer(timeout=1000 / 60, onTick=widget.onTick)
    app.run()
Example #2
0
    keyPressEvent = Window.keyPressEvent


def start(Widget):
    app = Application()
    widget = Widget(None)
    widget.show()
    app.startTimer(timeout=1000 / 60, onTick=widget.onTick)
    app.run()


if __name__ == '__main__':
    import sb03a, sb03b, sb03c, sb03d, sb03e, sb03f, sb03g

    app = Application()
    app.startTimer(1000 / 60)

    w = SB03(None)
    grid = QGridLayout(w)
    for r, c, W in [(1, 0, sb03a.W), (1, 1, sb03b.W), (1, 2, sb03c.W),
                    (2, 0, sb03d.W), (2, 1, sb03e.W), (2, 2, sb03f.W),
                    (3, 1, sb03g.W)]:
        wx = W(w, width=400, height=300)
        Application.addOnTick(wx.onTick)
        grid.addWidget(wx, r, c)
    w.setLayout(grid)
    w.show()

    import sys
    sys.exit(app.exec_())
Example #3
0
    def onTick(self): self.updateGL()

    keyPressEvent = Window.keyPressEvent

def start(Widget):
    app = Application()
    widget = Widget(None)
    widget.show()
    app.startTimer(timeout = 1000/60, onTick = widget.onTick)
    app.run()

if __name__ == '__main__':
    import sb03a, sb03b, sb03c, sb03d, sb03e, sb03f, sb03g

    app = Application()
    app.startTimer(1000/60)

    w = SB03(None)
    grid = QGridLayout(w)
    for r, c, W in [
            (1, 0, sb03a.W), (1, 1, sb03b.W), (1, 2, sb03c.W),
            (2, 0, sb03d.W), (2, 1, sb03e.W), (2, 2, sb03f.W),
            (3, 1, sb03g.W) ]:
        wx = W(w, width=400, height=300)
        Application.addOnTick(wx.onTick)
        grid.addWidget(wx, r, c)
    w.setLayout(grid)
    w.show()

    import sys
Example #4
0
def start(Widget):
    app = Application()
    widget = Widget(None)
    widget.show()
    app.startTimer(timeout = 1000/60, onTick = widget.onTick)
    app.run()
Example #5
0
        self.allocate(data, usage)

    def dataFormat(self,
                   elem,
                   nelems,
                   normalized=GL_FALSE,
                   stride=0,
                   offset=None):
        t = self._np2glType[elem.dtype]
        # print('dataFormat: buffer: {0}, bytes: {1}, type: {2}, offset: {3}'.format(self._buffer, elem.nbytes, t, offset))
        glVertexAttribPointer(self._buffer, nelems, t, normalized, stride,
                              offset)


if __name__ == '__main__':
    from sn.qt import Application, GLWidget
    app = Application()

    class Widget(GLWidget):
        def initializeGL(self):
            va = VertexArray()
            va.bind()
            vbs = VertexBuffer('position normal color texture')
            vbs.bind('position')
            vbs.bind('normal')
            vbs.bind('color')
            vbs.bind('texture')

    window = Widget(None)
    window.show()