Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I was bored and dragging my game window around the screen and noticed something interesting.

When I drag my game window over to my secondary monitor, the screen updating just completely freezes.

Is there something I need to do to enable updating on a screen other than the primary monitor?

share|improve this question
    
Are you using OpenGL, or Pygame/SDL's software buffers? –  user744 Aug 15 '11 at 20:26
    
Going with the Pygame/SDL software buffers. –  espais Aug 15 '11 at 20:51
    
Does the game window update if you drag it back to the primary monitor, or does it remain "frozen"? –  zenzelezz Aug 16 '11 at 11:22
    
@zenzelezz: yes it does –  espais Aug 16 '11 at 13:08
add comment

2 Answers

up vote 2 down vote accepted

This is a ERR in Pygame i'm sorry to say. Had this major problem when developing a toolkit for a company back in the days.

Edit: if the first "bug-ugly-fix" doesn't work, try my second suggestion!

The fix was sort of easy tho (if it works for you, this is NOT logical because it doesn't have anything to do with the actual problem BUT it worked for me, for some reason and), all you have to do is (before you call the render function):

# At the very top of your code, import:
from pyglet.gl import *

# then put this after clear() and before you draw anything:
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
glEnable(GL_LINE_SMOOTH)
glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE)

If i'm not mistaken this should work just fine, if that doesn't work then you can always force the application to start up on the second monitor if you know that it will always be located on it, that way you "start" the renderer on the second monitor and thus making that the primary monitor for the application, to do that, simply do:

class gfx(pyglet.window.Window):
    def __init__(self):
        super(gfx, self).__init__(sizeX, sizeY)
        self.platform = pyglet.window.get_platform()
        self.Disp = self.platform.get_default_display()
        self.Screen = self.Disp.get_screens()[screen_nr]

    ...

That should do the trick for you :)

share|improve this answer
2  
Why have you answered a pygame question with a pyglet solution? –  Kylotan Sep 7 '11 at 15:11
add comment

Assuming you are using two separate graphics cards for the monitors in question, you have bound to the primary graphics card on the main monitor, and then drag it to the monitor the second card is rendering with. on -most- systems you will just take a huge performance hit as it still renders on the primary graphic card but then copies the data to the other one for display. In your case however it would seem its not capable of doing that.

All I know however is the hardware flow behind it, not the python and pygame software on top of it all.. But I would assume this hardware issue is why you are seeing your issues.

share|improve this answer
    
This sounds very unlikely if espais is using SDL's software renderer. –  user744 Aug 15 '11 at 21:15
    
@Joe May seem unlikely, but the description and the follow up in the comments is spot on for rendering across multiple displays and their adapters... The targets were set upon start up and do not change when you drag the window around. –  James Aug 17 '11 at 19:42
    
I agree this is often the cause of problems, but even using terms like "targets" doesn't make sense given what espais is claiming to use. –  user744 Aug 17 '11 at 19:53
    
Yeah, with out knowing what SDL actually does for its rendering it ends up being an unknown, and maybe even platform dependent with Windows 7 now being powered by DirectX... –  James Aug 17 '11 at 23:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.