Example #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__)
Example #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__)
Example #3
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__)
Example #4
0
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__)
Example #5
0
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__)
Example #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__)
Example #7
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__)
Example #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__)
Example #9
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__)
Example #10
0
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
Example #11
0
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__)
Example #12
0
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
Example #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())
Example #14
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())