Yes, if you don't select a backend renderer for pyimgui, it won't render anything. I think you might find an imgui.ini file with imgui's interpretation of what you've asked for, in the current directory, but you won't get any graphical output.
To get graphical output, select a renderer, like in this file in the master pyimgui repository:
https://github.com/swistakm/pyimgui/blob/master/doc/examples/integrations_pygame.py
Note that, as I write this, most but not all of the examples in this directory work:
https://github.com/swistakm/pyimgui/tree/master/doc/examples
The "all in one" example did not work for me, and the SDL2 example required changing:
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 16)
to:
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4)
as my GPU doesn't seem to do 16-point multisampling.
Also, these examples don't play well with Python3 in that the error prints() are wrong, and will fail instead of printing a useful error:
print("Error: SDL could not initialize! SDL Error: " + SDL_GetError())
should be:
print("Error: SDL could not initialize! SDL Error: ", SDL_GetError())
So, if you get any errors at these lines, you know what to do. :-)
Finally, for future searchers, here is a quick cut and paste of the pygame version which works for me (from https://github.com/swistakm/pyimgui/blob/master/doc/examples/integrations_pygame.py ). I ran it with python 3.6:
#!/usr/bin/env python3
from __future__ import absolute_import
import sys
import pygame
import OpenGL.GL as gl
from imgui.integrations.pygame import PygameRenderer
import imgui
def main():
pygame.init()
size = 800, 600
pygame.display.set_mode(size, pygame.DOUBLEBUF | pygame.OPENGL | pygame.RESIZABLE)
imgui.create_context()
impl = PygameRenderer()
io = imgui.get_io()
io.display_size = size
while 1:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
impl.process_event(event)
imgui.new_frame()
if imgui.begin_main_menu_bar():
if imgui.begin_menu("File", True):
clicked_quit, selected_quit = imgui.menu_item(
"Quit", 'Cmd+Q', False, True
)
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()
# 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()
impl.render(imgui.get_draw_data())
pygame.display.flip()
if __name__ == "__main__":
main()