[Windows] Problem when drawing the window

Issue #132 new
Tais Reis
created an issue

I did an exe with the Pyinstaller of my project and when I execute the exe in other computer the labels, fonts and images or not are drawing or not appears. This occour only in some computers in others works fine. Follow the specifications:

Python 3.5.3 Pyinstaller 3.2.1 Pyglet 1.2.4 Windows 7 Professional 32-bit Card name: Intel(R) HD Graphics

Comments (15)

  1. Tais Reis reporter

    Hi Benjamin, I changed to resource but does not work. When I run it it changes the render, one time show the text, after one second hidden the text and show the image, an after hidden the image and show the gif and the cycle repeats itself.

  2. Benjamin Moran

    There are some possible issues in your code, for example, you are recreating the keystatehandler and pushing it every frame (in the on_draw method). Also, you shouldn't call the on_draw method directly)

    Before calling pyglet.app.run, try to add pyglet.clock.schedule_interval(lambda dt: None, 1/60.0)

    If this has no effect, please share your latest code (after switching to the resource module).

    Thanks, -Ben

  3. Tais Reis reporter

    Hi Ben,

    Unfortunately I changed the code and still I continue with the same error. Follow the code attach. I changed to resource module, commented the on_draw function, commented the KeyStateHandler and add the pyglet.clock.schedule_interval(lambda dt: None, 1/60.0) before calling pyglet.app.run.
    Tks !

  4. Benjamin Moran

    Your code looks fine now, and works on my Linux machine. I don't see any reason why it shouldn't work on other computers.

    If it's possible, please post the pyglet debug info from the computer that doesn't work: python -m pyglet.info

    The resources should be found correctly now. If there was any issue, we would expect a crash/traceback.

    Also, if possible, you might want to try the latest development version of pyglet (v1.3.0a1) from Bitbucket. It contains a lot of bug fixes.

  5. Benjamin Moran

    You can try a simple test application with this, or put it at the top of your existing app:

    from pyglet import info
    
    info.dump()
    

    That should do the same thing as the line above. However, there may be some settings that you need to set in PyInstaller so that you can get it to show the console output when running a frozen app. I don't have a Windows box handy to test it right now, unfortunately.

    At the least, the pyglet.info dump will let us know if there is some potentially problematic driver on your users machine.

  6. Benjamin Moran

    I think this is the problem:

    glu_info.get_version(): 1.2.2.0 Microsoft Corporation
    

    If I'm not mistaken, the OpenGL drivers from Intel are not installed, and it's falling back to the generic older GL support that ships with Windows. I've seen it said before that a black screen is an indication of this. The generic GL drivers are missing lots of features/extensions, but they will pass silently instead of crashing.

    If the user has installed their Intel graphics drivers from Windows Update, there is a good change that OpenGL drivers are not included in that. They should try updating them directly from Intel, which will hopefully get this working!

  7. Tais Reis reporter

    Hi Ben

    Unfortunately i can't install the Python in this machine. You think that this problem can be the configuration low of the machine? The Pyglet have minimum requirements?

  8. Benjamin Moran

    Hi Tais,

    Sorry for the slow reply. Pyglet's minimum graphics requirements are only OpenGL 2.0. The problem, is that many older OpenGL drivers are really buggy or incomplete. This is very true when dealing with Laptops or mobile GPUs. In many cases they even lie about their capabilities, so it's really frustrating to troubleshoot.

    However, I had another idea to try. Since you're using PyInstaller, there might be an issue with the resource locations. Can you try to add the following code into your application somewhere?:

    import sys
    
    frozen = getattr(sys, 'frozen', None)
    meipass = getattr(sys, '_MEIPASS', None)
    
    print(frozen, meipass)
    print(pyglet.resource.get_script_home())
    

    PyInstaller will add these attributes, to help find the location of the assets. I'm not sure if this is the problem, because usally the application will just crash if it can't load something. Still, it's worth a try to see if the issue could be the resource locations.

  9. Log in to comment