Ошибка при запуске приложения с OpenGL: execution of module OpenGL_accelerate.numpy_formathandler raised unreported exception
Сам код
import glfw
import OpenGL.GL as gl
import imgui
from imgui.integrations.glfw import GlfwRenderer
import menu
def main():
imgui.create_context()
window = impl_glfw_init()
impl = GlfwRenderer(window)
while not glfw.window_should_close(window):
glfw.poll_events()
impl.process_inputs()
imgui.push_style_var(imgui.STYLE_WINDOW_ROUNDING, 0.0)
imgui.core.style_colors_light()
imgui.new_frame()
menu.menu()
gl.glClearColor(0.3, 0.3, 0.3, 0.3)
gl.glClear(gl.GL_COLOR_BUFFER_BIT)
imgui.render()
impl.render(imgui.get_draw_data())
glfw.swap_buffers(window)
impl.shutdown()
glfw.terminate()
def impl_glfw_init():
if not glfw.init():
print("not initialize OpenGL context")
exit(1)
glfw.window_hint(glfw.CONTEXT_VERSION_MAJOR, 3)
glfw.window_hint(glfw.CONTEXT_VERSION_MINOR, 3)
glfw.window_hint(glfw.OPENGL_PROFILE, glfw.OPENGL_CORE_PROFILE)
glfw.window_hint(glfw.OPENGL_FORWARD_COMPAT, gl.GL_TRUE)
window = glfw.create_window(
int(1280), int(720), "Application", None, None
)
glfw.make_context_current(window)
if not window:
glfw.terminate()
print("not initialize Window")
exit(1)
return window
if __name__ == "__main__":
main()
Ошибка
Traceback (most recent call last):
File "c:\Users\Acer\Desktop\PyImgui project\main.py", line 62, in <module>
main()
File "c:\Users\Acer\Desktop\PyImgui project\main.py", line 13, in main
impl = GlfwRenderer(window)
File "C:\Users\Acer\AppData\Local\Programs\Python\Python310\lib\site-packages\imgui\integrations\glfw.py", line 12, in __init__
super(GlfwRenderer, self).__init__()
File "C:\Users\Acer\AppData\Local\Programs\Python\Python310\lib\site-packages\imgui\integrations\opengl.py", line 60,
in __init__
super(ProgrammablePipelineRenderer, self).__init__()
File "C:\Users\Acer\AppData\Local\Programs\Python\Python310\lib\site-packages\imgui\integrations\base.py", line 17, in __init__
self._create_device_objects()
File "C:\Users\Acer\AppData\Local\Programs\Python\Python310\lib\site-packages\imgui\integrations\opengl.py", line 84,
in _create_device_objects
last_texture = gl.glGetIntegerv(gl.GL_TEXTURE_BINDING_2D)
File "src/latebind.pyx", line 39, in OpenGL_accelerate.latebind.LateBind.__call__
File "src/wrapper.pyx", line 303, in OpenGL_accelerate.wrapper.Wrapper.__call__
File "src/wrapper.pyx", line 88, in OpenGL_accelerate.wrapper.CArgCalculator.c_call
File "src/wrapper.pyx", line 69, in OpenGL_accelerate.wrapper.CArgCalculatorElement.c_call
File "src/wrapper.pyx", line 64, in OpenGL_accelerate.wrapper.CArgCalculatorElement.c_call
File "src/arraydatatype.pyx", line 355, in OpenGL_accelerate.arraydatatype.SizedOutputOrInput.c_call
File "src/arraydatatype.pyx", line 224, in OpenGL_accelerate.arraydatatype.ArrayDatatype.c_zeros
File "src/arraydatatype.pyx", line 69, in OpenGL_accelerate.arraydatatype.HandlerRegistry.c_get_output_handler
File "src/arraydatatype.pyx", line 80, in OpenGL_accelerate.arraydatatype.HandlerRegistry.c_handler_by_plugin_name
File "C:\Users\Acer\AppData\Local\Programs\Python\Python310\lib\site-packages\OpenGL\plugins.py", line 18, in load
return importByName( self.import_path )
File "C:\Users\Acer\AppData\Local\Programs\Python\Python310\lib\site-packages\OpenGL\plugins.py", line 45, in importByName
module = __import__( ".".join(moduleName), {}, {}, moduleName)
File "C:\Users\Acer\AppData\Local\Programs\Python\Python310\lib\site-packages\OpenGL\arrays\numpymodule.py", line 28,
in <module>
from OpenGL_accelerate.numpy_formathandler import NumpyHandler
SystemError: ('execution of module OpenGL_accelerate.numpy_formathandler raised unreported exception', 1, <OpenGL.platform.baseplatform.glGetIntegerv object at 0x000002BB0898EB00>)