How to use the imgui.render function in imgui

To help you get started, we’ve selected a few imgui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github swistakm / pyimgui / doc / examples / pysdl2.py View on Github external
exit(1)

                imgui.end_menu()
            imgui.end_main_menu_bar()

        imgui.show_test_window()

        imgui.begin("Custom window", True)
        imgui.text("Bar")
        imgui.text_colored("Eggs", 0.2, 1., 0.)
        imgui.end()

        gl.glClearColor(1., 1., 1., 1)
        gl.glClear(gl.GL_COLOR_BUFFER_BIT)

        imgui.render()

        SDL_GL_SwapWindow(window)

    renderer.shutdown()
    SDL_GL_DeleteContext(gl_context)
    SDL_DestroyWindow(window)
    SDL_Quit()
github moderngl / moderngl-window / examples / integration_imgui.py View on Github external
)

                if clicked_quit:
                    exit(1)

                imgui.end_menu()
            imgui.end_main_menu_bar()

        imgui.show_test_window()

        imgui.begin("Custom window", True)
        imgui.text("Bar")
        imgui.text_colored("Eggs", 0.2, 1., 0.)
        imgui.end()

        imgui.render()
        self.imgui.render(imgui.get_draw_data())
github christopherdumas / atomicdatabase / AtomicDatabase / __main__.py View on Github external
draw_imgui_table_database(DB)
        draw_imgui_eav_database(DB)
        draw_imgui_database_rules(DB, font_extra2)
        draw_imgui_attribute_metadata(DB)
        draw_imgui_query_box(DB, font_extra2)
        draw_imgui_constants_window(DB)

        # pop the style vars (this is required by Dear ImGui)
        imgui.pop_style_var(7)
        imgui.pop_style_color(19)

        # clear the background
        gl.glClearColor(1., 1., 1., 1)
        gl.glClear(gl.GL_COLOR_BUFFER_BIT)

        imgui.render()

        SDL_GL_SwapWindow(window)

        SDL_Delay(time_left(next_time))
        next_time += TICK_INTERVAL

    # close the window
    renderer.shutdown()
    SDL_GL_DeleteContext(gl_context)
    SDL_DestroyWindow(window)
    SDL_Quit()
github pthom / imgui_datascience / imgui_datascience / imgui_runner.py View on Github external
imgui.new_frame()
        if params.provide_default_window:
            imgui.set_next_window_position(0, 0)
            imgui.set_next_window_size(win_size[0], win_size[1])
            imgui.begin("Default window")
        gui_loop_function()
        if params.provide_default_window:
            imgui.end()
        ImGuiImageLister._heartbeat()

        # note: cannot use screen.fill((1, 1, 1)) because pygame's screen
        #       does not support fill() on OpenGL surfaces
        gl.glClearColor(1, 1, 1, 1)
        gl.glClear(gl.GL_COLOR_BUFFER_BIT)
        imgui.render()
        pygame_renderer.render(imgui.get_draw_data())
        pygame.display.flip()

        imgui_cv._clear_all_cv_textures()
        imgui_ext.__clear_all_unique_labels()
github swistakm / pyimgui / doc / examples / combined.py View on Github external
def draw(self, *args, **kwargs):
            imgui.new_frame()
            on_frame()
            gl.glClearColor(1., 1., 1., 1)
            gl.glClear(gl.GL_COLOR_BUFFER_BIT)
            imgui.render()
github swistakm / pyimgui / doc / source / gen_example.py View on Github external
imgui.end()

        # retrieve pixels from framebuffer and write to file
        pixels = gl.glReadPixels(0, 0, width, height, gl.GL_RGBA, gl.GL_UNSIGNED_BYTE)
        image = Image.frombytes('RGBA', (width, height), pixels)
        # note: glReadPixels returns lines "bottom to top" but PIL reads bytes
        #       top to bottom
        image = image.transpose(Image.FLIP_TOP_BOTTOM)
        image_list.append(image)

        gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, offscreen_fb)

        gl.glClearColor(1, 1, 1, 0)
        gl.glClear(gl.GL_COLOR_BUFFER_BIT)

        imgui.render()

    if animated:
        pass
    else:
        image_list[-1].save(os.path.join(output_dir, file_path))

    glfw.terminate()
github nx-python / PyNX / main.py View on Github external
imgui.end()

        if ERROR:
            imgui.set_next_window_size(width, height)
            imgui.set_next_window_position(0, 0)
            imgui.begin("ERROR", 
                flags=imgui.WINDOW_NO_RESIZE | imgui.WINDOW_NO_MOVE | imgui.WINDOW_NO_SAVED_SETTINGS
            )
            imgui.text(str(ERROR))
            if imgui.button("OK", width=200, height=60):
                ERROR = ""
            imgui.end()

        imgui.render()
        renderer.render()

    renderer.shutdown()
github swistakm / pyimgui / doc / examples / pygame_.py View on Github external
imgui.end_menu()
            imgui.end_main_menu_bar()

        imgui.show_test_window()

        imgui.begin("Custom window", True)
        imgui.text("Bar")
        imgui.text_colored("Eggs", 0.2, 1., 0.)
        imgui.end()

        # note: cannot use screen.fill((1, 1, 1)) because pygame's screen
        #       does not support fill() on OpenGL sufraces
        gl.glClearColor(1, 1, 1, 1)
        gl.glClear(gl.GL_COLOR_BUFFER_BIT)
        imgui.render()

        pygame.display.flip()