コード例 #1
0
def process(dt):

    # Poll for and process events
    glfw.glfwPollEvents()

    for window in __windows__:
        window.activate()

        window.imguiRenderer.process_inputs()

        # Dispatch the main draw event
        window.dispatch_event('on_draw', dt)

        # Dispatch the idle event
        window.dispatch_event('on_idle', dt)

        imgui_draw_data = imgui.get_draw_data()
        if imgui_draw_data is not None:
            window.imguiRenderer.render(imgui_draw_data)

        # Swap buffers
        window.swap()

    for window in __windows_to_remove__:
        window.destroy()
        __windows_to_remove__.remove(window)

    return len(__windows__)
コード例 #2
0
def process(dt):

    # Poll for and process events
    glut.glutMainLoopEvent()

    for window in __windows__:
        window.activate()

        # Dispatch the main draw event
        window.dispatch_event('on_draw', dt)

        # Dispatch the idle event
        window.dispatch_event('on_idle', dt)

        # Swap buffers
        window.swap()

    return len(__windows__)
コード例 #3
0
ファイル: backend_freeglut.py プロジェクト: jk34/glumpy
def process(dt):

    # Poll for and process events
    glut.glutMainLoopEvent()

    for window in __windows__:
        window.activate()

        # Dispatch the main draw event
        window.dispatch_event('on_draw', dt)

        # Dispatch the idle event
        window.dispatch_event('on_idle', dt)

        # Swap buffers
        window.swap()

    return len(__windows__)
コード例 #4
0
ファイル: backend_glfw.py プロジェクト: yuyu2172/glumpy
def process(dt):

    # Poll for and process events
    glfw.glfwPollEvents()

    for window in __windows__:
        # Make window active
        window.activate()

        # Dispatch the main draw event
        window.dispatch_event('on_draw', dt)

        # Dispatch the idle event
        window.dispatch_event('on_idle', dt)

        # Swap buffers
        window.swap()

    return len(__windows__)
コード例 #5
0
ファイル: backend_glfw.py プロジェクト: WhiteSymmetry/glumpy
def process(dt):

    # Poll for and process events
    glfw.glfwPollEvents()

    for window in __windows__:
        # Make window active
        window.activate()

        # Dispatch the main draw event
        window.dispatch_event('on_draw', dt)

        # Dispatch the idle event
        window.dispatch_event('on_idle', dt)

        # Swap buffers
        window.swap()


    return len(__windows__)
コード例 #6
0
def process(dt):

    for window in __windows__:

        # Activate window
        window.activate()

        # Dispatch any pending event
        window._native_window.dispatch_events()

        # Dispatch the main draw event
        window.dispatch_event('on_draw', dt)

        # Dispatch the idle event
        window.dispatch_event('on_idle', dt)

        # Swap buffers
        window.swap()

    return len(__windows__)
コード例 #7
0
ファイル: backend_pyglet.py プロジェクト: jk34/glumpy
def process(dt):

    for window in __windows__:

        # Activate window
        window.activate()

        # Dispatch any pending event
        window._native_window.dispatch_events()

        # Dispatch the main draw event
        window.dispatch_event("on_draw", dt)

        # Dispatch the idle event
        window.dispatch_event("on_idle", dt)

        # Swap buffers
        window.swap()

    return len(__windows__)
コード例 #8
0
def process(dt):

    # Poll for and process events
    # -> Add toolkit specific code here to process events
    # -> Must always exit

    for window in __windows__:
        # Make window active
        window.activate()

        # Clear window using window clear flags
        gl.glClear(window._clearflags)

        # Dispatch the main draw event
        window.dispatch_event('on_draw', dt)

        # Dispatch the idle event
        window.dispatch_event('on_idle', dt)

        # Swap buffers
        window.swap()

    return len(__windows__)
コード例 #9
0
ファイル: backend_template.py プロジェクト: jk34/glumpy
def process(dt):

    # Poll for and process events
    # -> Add toolkit specific code here to process events
    # -> Must always exit

    for window in __windows__:
        # Make window active
        window.activate()

        # Clear window using window clear flags
        gl.glClear(window._clearflags)

        # Dispatch the main draw event
        window.dispatch_event('on_draw', dt)

        # Dispatch the idle event
        window.dispatch_event('on_idle', dt)

        # Swap buffers
        window.swap()

    return len(__windows__)
コード例 #10
0
ファイル: backend_sdl.py プロジェクト: wzunknown/glumpy
def process(dt):

    if not len(__windows__):
        return 0

    window = __windows__[0]

    # Poll for and process events
    for event in pygame.event.get():
        window.process_event(event)

    # Activate window
    window.activate()

    # Dispatch the main draw event
    window.dispatch_event('on_draw', dt)

    # Dispatch the idle event
    window.dispatch_event('on_idle', dt)

    # Swap buffers
    window.swap()

    return 1
コード例 #11
0
ファイル: backend_template.py プロジェクト: drufat/glumpy
def process(dt):
    """ Process events for all windows. Non blocking. """

    # Poll for and process events
    # -> Add toolkit specific code here to process events
    # -> Must return (non bloking)

    for window in __windows__:
        # Make window active
        window.activate()

        # Clear window using window clear flags
        gl.glClear(window._clearflags)

        # Dispatch the main draw event
        window.dispatch_event("on_draw", dt)

        # Dispatch the idle event
        window.dispatch_event("on_idle", dt)

        # Swap buffers
        window.swap()

    return len(__windows__)
コード例 #12
0
ファイル: backend_sdl.py プロジェクト: glumpy/glumpy
def process(dt):

    if not len(__windows__):
        return 0

    window = __windows__[0]

    # Poll for and process events
    for event in pygame.event.get():
        window.process_event(event)

    # Activate window
    window.activate()

    # Dispatch the main draw event
    window.dispatch_event('on_draw', dt)

    # Dispatch the idle event
    window.dispatch_event('on_idle', dt)

    # Swap buffers
    window.swap()

    return 1
コード例 #13
0
def process(dt):

    # Poll for and process events
    event = sdl2.SDL_Event()
    while sdl2.SDL_PollEvent(ctypes.byref(event)) != 0:
        win_id = event.window.windowID
        if win_id in __windows__.keys():
            win = __windows__[win_id]
            win.process_event(event)

    for window in windows():
        # Make window active
        window.activate()

        # Dispatch the main draw event
        window.dispatch_event('on_draw', dt)

        # Dispatch the idle event
        window.dispatch_event('on_idle', dt)

        # Swap buffers
        window.swap()

    return len(__windows__.values())
コード例 #14
0
ファイル: backend_sdl2.py プロジェクト: jk34/glumpy
def process(dt):

    # Poll for and process events
    event = sdl2.SDL_Event()
    while sdl2.SDL_PollEvent(ctypes.byref(event)) != 0:
        win_id = event.window.windowID
        if win_id in __windows__.keys():
            win = __windows__[win_id]
            win.process_event(event)

    for window in windows():
        # Make window active
        window.activate()

        # Dispatch the main draw event
        window.dispatch_event('on_draw', dt)

        # Dispatch the idle event
        window.dispatch_event('on_idle', dt)

        # Swap buffers
        window.swap()

    return len(__windows__.values())