Пример #1
0
import posix,posixpath

if sys.version_info.major > 2:
    basestring = str
from modproxy import ModuleProxy
from glproxy  import gl, glx
from qtproxy import Q, QW, QG
#from PyQt5 import Qt as Q, QtWidgets as QW, QtGui as QG

from topwindow import TopWindow
from player import Player

if __name__ == '__main__':
#    Q.QSurfaceFormat.setDefaultFormat(fmt)
    app = Q.QApplication(sys.argv)

#    player = Player()
    args = list()
    kwargs = dict()
    for arg in sys.argv[1:]:
        if '=' in arg:
            parts = arg.partition('=')
            kwargs[parts[0]] = parts[2]
        else:
            args.append(arg)

    with SignalWakeupHandler(app):
        signal.signal(signal.SIGINT, lambda *a:app.quit())

        win = TopWindow(*args, **kwargs)
Пример #2
0
    #    fmt.setProfile(fmt.CoreProfile)
    #    fmt.setDepthBufferSize(24)
    #    fmt.setRedBufferSize(8)
    #    fmt.setGreenBufferSize(8)
    #    fmt.setBlueBufferSize(8)
    #    fmt.setAlphaBufferSize(8)
    #    fmt.setSwapBehavior(fmt.TripleBuffer)
    #    fmt.setSwapBehavior(fmt.SingleBuffer)
    #    fmt.setRenderableType(fmt.OpenGL)
    #    fmt.setOption(fmt.DeprecatedFunctions,False)
    #    fmt.setOption(fmt.ResetNotification,True)
    #    Q.QSurfaceFormat.setDefaultFormat(fmt)

    #    Q.QCoreApplication.setAttribute(Q.Qt.AA_ShareOpenGLContexts)

    app = Q.QApplication([])

    mw = Canvas()
    if args.forcerate is not None and args.forcerate:
        mw.forcedFrameRate = args.forcerate
#    else:
#        mw.forcedFrameRate = None

    ap = mw.playerwidget

    if args.getprocaddress:
        ap._get_proc_address = args.getprocaddress
    if args.getprocaddressquiet:
        ap._get_proc_address_debug = False

    def dump_fmt(fmt):