I'm using the PySFML2 bindings, but I'm pretty sure it's not an issue with the bindings.
I tried using a RenderTexture, and got no output where it was meant to be drawn. Wondering what the issue was I made a simple test script, which ran fine.
I then spent ages changing stuff around. After a lot of painful testing, I eventually went back to my test script to find out it had stopped working - despite nothing having changed.
I eventually worked out the only thing that had changed was what monitor I was using. I moved the window back to the first monitor, and it shows up fine.
Is this a bug that is fixable, or something due to my setup?
import sf
def main():
window = sf.RenderWindow(sf.VideoMode(640, 480), b'Sprite example')
window.framerate_limit = 60
running = True
image = sf.RenderTexture(300, 300)
image.create(300, 300)
sprite = sf.Sprite(image.texture)
image.clear(sf.Color.BLACK)
image.draw(sf.Shape.rectangle(10, 10, 100, 100, sf.Color.BLUE))
image.display()
while running:
for event in window.iter_events():
if event.type == sf.Event.CLOSED:
running = False
window.clear(sf.Color.WHITE)
window.draw(sprite)
window.display()
window.close()
if __name__ == '__main__':
main()
This shows the bug for me. On my leftmost monitor it works, the other two it doesn't. I run 3 monitors with two nVidia cards, nVidia proprietary driver, Arch Linux.
Weirdly, the device it works on is the same graphics card as the middle one, and the rightmost one is on the other card. It only works on the first. This leads me to think it's not an issue with my exact setup (the cards) and more the multi-monitor setup.[/quote]