packages/pyglGA/scripts/basicWindow.py
def main():
    """
    The main method that after calling init() it starts the main rendering loop.
    This loop re-draws an ImGUI sample window in immediate mode and swaps the SDL2 double buffer windows
    """
    
    gWindow, gContext, gVersionLabel = init()
    #ImGui.create_default_context(purpose=Purpose.SERVER_AUTH, cafile=None, capath=None, cadata=None)
    imguiContext = ImGui.create_context()
    
    if imguiContext is None:
        print("Window could not be created! ImGUI Error: ")
        exit(1)
    else:
        print("Yay! ImGUI context created successfully in basicWindow")
        
    renderer = SDL2Renderer(gWindow)

    running = True
    # MAIN LOOP
    while running:
        events = sdl2.ext.get_events()
        for event in events:
            if event.type == SDL_KEYDOWN:
                if event.key.keysym.sym == SDLK_ESCAPE:
                    running = False
            if event.type == SDL_QUIT:
                running = False
            renderer.process_event(event)
        renderer.process_inputs()

        glClearColor(0.0, 0.0, 0.0, 1)
        glClear(GL_COLOR_BUFFER_BIT)

        ImGui.set_next_window_size(300.0, 150.0)

        # start new frame context
        ImGui.new_frame()
        
        #a sample imGUI window with all widgets
        ImGui.show_test_window()
        
        # open new window context
        ImGui.begin("Our first window!", True)
        # draw text label inside of current window
        ImGui.text("PyImgui + PySDL2 integration successful!")
        ImGui.text(gVersionLabel)
        # close current window context
        ImGui.end()
        # pass all drawing commands to the rendering pipeline
        # and close frame context
        ImGui.render()
        renderer.render(ImGui.get_draw_data())

        SDL_GL_SwapWindow(gWindow)
    # CLOSING
    renderer.shutdown()
    SDL_GL_DeleteContext(gContext)
    SDL_DestroyWindow(gWindow)
    SDL_Quit()

    The main method that after calling init() it starts the main rendering loop.
    This loop re-draws an ImGUI sample window in immediate mode and swaps the SDL2 double buffer windows
    
The main method that after calling init() it starts the main rendering loop.
This loop re-draws an ImGUI sample window in immediate mode and swaps the SDL2 double buffer windows
The main method that after calling init () it starts the main rendering loop . This loop re - draws an ImGUI sample window in immediate mode and swaps the SDL2 double buffer windows
def main():
    gWindow, gContext, gVersionLabel = init()
    imguiContext = ImGui.create_context()
    if imguiContext is None:
        print("Window could not be created! ImGUI Error: ")
        exit(1)
    else:
        print("Yay! ImGUI context created successfully in basicWindow")
    renderer = SDL2Renderer(gWindow)
    running = True
    while running:
        events = sdl2.ext.get_events()
        for event in events:
            if event.type == SDL_KEYDOWN:
                if event.key.keysym.sym == SDLK_ESCAPE:
                    running = False
            if event.type == SDL_QUIT:
                running = False
            renderer.process_event(event)
        renderer.process_inputs()
        glClearColor(0.0, 0.0, 0.0, 1)
        glClear(GL_COLOR_BUFFER_BIT)
        ImGui.set_next_window_size(300.0, 150.0)
        ImGui.new_frame()
        ImGui.show_test_window()
        ImGui.begin("Our first window!", True)
        ImGui.text("PyImgui + PySDL2 integration successful!")
        ImGui.text(gVersionLabel)
        ImGui.end()
        ImGui.render()
        renderer.render(ImGui.get_draw_data())
        SDL_GL_SwapWindow(gWindow)
    renderer.shutdown()
    SDL_GL_DeleteContext(gContext)
    SDL_DestroyWindow(gWindow)
    SDL_Quit()
def main ( ) : gWindow , gContext , gVersionLabel = init ( ) imguiContext = ImGui . create_context ( ) if imguiContext is None : print ( "Window could not be created! ImGUI Error: " ) exit ( 1 ) else : print ( "Yay! ImGUI context created successfully in basicWindow" ) renderer = SDL2Renderer ( gWindow ) running = True while running : events = sdl2 . ext . get_events ( ) for event in events : if event . type == SDL_KEYDOWN : if event . key . keysym . sym == SDLK_ESCAPE : running = False if event . type == SDL_QUIT : running = False renderer . process_event ( event ) renderer . process_inputs ( ) glClearColor ( 0.0 , 0.0 , 0.0 , 1 ) glClear ( GL_COLOR_BUFFER_BIT ) ImGui . set_next_window_size ( 300.0 , 150.0 ) ImGui . new_frame ( ) ImGui . show_test_window ( ) ImGui . begin ( "Our first window!" , True ) ImGui . text ( "PyImgui + PySDL2 integration successful!" ) ImGui . text ( gVersionLabel ) ImGui . end ( ) ImGui . render ( ) renderer . render ( ImGui . get_draw_data ( ) ) SDL_GL_SwapWindow ( gWindow ) renderer . shutdown ( ) SDL_GL_DeleteContext ( gContext ) SDL_DestroyWindow ( gWindow ) SDL_Quit ( )
The main method that after calling init() it starts the main rendering loop.
The main method that after calling init () it starts the main rendering loop .
"""
    The main method that after calling init() it starts the main rendering loop.
    This loop re-draws an ImGUI sample window in immediate mode and swaps the SDL2 double buffer windows
    """ #ImGui.create_default_context(purpose=Purpose.SERVER_AUTH, cafile=None, capath=None, cadata=None) # MAIN LOOP # start new frame context #a sample imGUI window with all widgets # open new window context # draw text label inside of current window # close current window context # pass all drawing commands to the rendering pipeline # and close frame context # CLOSING