directx not available due to SDL_VIDEODRIVER environment variable

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
aJax
Newbie
Posts: 6
Joined: Mon Feb 19, 2018 9:20 am
Contact:

directx not available due to SDL_VIDEODRIVER environment variable

#1 Post by aJax »

Hi,

I had a bug I was able to solve. I would like to share the solution in case somebody also has it.

For some reasons I had the system environment variable SDL_VIDEODRIVER set to 'directx'. This is probably due to a previous installation of pygame. This made renpy crash (see below). The solution is simply to delete the SDL_VIDEODRIVER environment variable.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/00start.rpy", line 207, in script call
    call _gl_test
  File "renpy/common/00gltest.rpy", line 390, in script
    $ __gl_test()
  File "renpy/common/00start.rpy", line 207, in script call
    call _gl_test
  File "renpy/common/00gltest.rpy", line 390, in script
    $ __gl_test()
  File "renpy/common/00gltest.rpy", line 390, in <module>
    $ __gl_test()
  File "renpy/common/00gltest.rpy", line 317, in _m1_00gltest__gl_test
    _gl_performance_test()
  File "renpy/common/00gltest.rpy", line 342, in _gl_performance_test
    ui.interact(suppress_underlay=True, suppress_overlay=True)
error: directx not available

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "renpy/bootstrap.py", line 331, in bootstrap
    renpy.main.main()
  File "renpy/main.py", line 662, in main
    run(restart)
  File "renpy/main.py", line 148, in run
    renpy.execution.run_context(True)
  File "renpy/execution.py", line 922, in run_context
    context.run()
  File "renpy/common/00start.rpy", line 207, in script call
    call _gl_test
  File "renpy/common/00gltest.rpy", line 390, in script
    $ __gl_test()
  File "renpy/common/00start.rpy", line 207, in script call
    call _gl_test
  File "renpy/common/00gltest.rpy", line 390, in script
    $ __gl_test()
  File "renpy/ast.py", line 928, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "renpy/python.py", line 2245, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "renpy/common/00gltest.rpy", line 390, in <module>
    $ __gl_test()
  File "renpy/common/00gltest.rpy", line 317, in _m1_00gltest__gl_test
    _gl_performance_test()
  File "renpy/common/00gltest.rpy", line 342, in _gl_performance_test
    ui.interact(suppress_underlay=True, suppress_overlay=True)
  File "renpy/ui.py", line 298, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "renpy/display/core.py", line 3286, in interact
    self.start()
  File "renpy/display/core.py", line 2227, in start
    self.set_mode()
  File "renpy/display/core.py", line 2535, in set_mode
    if draw.init(virtual_size):
  File "gl2draw.pyx", line 296, in renpy.gl2.gl2draw.GL2Draw.init
  File "gl2draw.pyx", line 163, in renpy.gl2.gl2draw.GL2Draw.select_physical_size
  File "renpy/display/__init__.py", line 53, in get_info
    pygame.display.init()
  File "src/pygame_sdl2/display.pyx", line 95, in pygame_sdl2.display.init
error: directx not available

Windows-10-10.0.19041
Ren'Py 7.4.11.2266
Ren'Py Launcher 7.4.11.2266
Thu Apr 21 17:11:08 2022

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: directx not available due to SDL_VIDEODRIVER environment variable

#2 Post by PyTom »

I don't think this is a bug in Ren'Py - SDL_VIDEODRIVER is a way people might plausibly want to control Ren'Py, and so it makes sense that Ren'Py respects it.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: No registered users