Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: RenderTexture and Multi-monitor setups.  (Read 2877 times)

0 Members and 1 Guest are viewing this topic.

lattyware

  • Newbie
  • *
  • Posts: 9
    • View Profile
RenderTexture and Multi-monitor setups.
« on: August 28, 2011, 02:59:21 am »
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?

Code: [Select]
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]

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
RenderTexture and Multi-monitor setups.
« Reply #1 on: August 28, 2011, 09:26:01 am »
I have no idea, sorry. This is the kind of problem which is hard to reproduce, and really complicated to solve :?
Laurent Gomila - SFML developer

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
RenderTexture and Multi-monitor setups.
« Reply #2 on: August 28, 2011, 01:00:27 pm »
You are aware you create the render texture twice?

Anyway what happens if you do the render of the texture in the loop as well?
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

lattyware

  • Newbie
  • *
  • Posts: 9
    • View Profile
RenderTexture and Multi-monitor setups.
« Reply #3 on: August 28, 2011, 01:27:47 pm »
Quote from: "Groogy"
You are aware you create the render texture twice?

Anyway what happens if you do the render of the texture in the loop as well?


Ah, that was just a leftover from when I was checking that the bindings did the create automatically - they do, I checked the source in the end, it works with or without that bit, but only on the first monitor.

Rendering the texture in the loop doesn't do anything either - and if I did that, it'd kind of defy the point of using a RenderTexture.

If there is anything I can do to help isolate the issue, do let me know.

Just to show you quite how weird it is:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
RenderTexture and Multi-monitor setups.
« Reply #4 on: August 28, 2011, 05:33:07 pm »
SFML doesn't handle multi-monitors at the moment, so maybe it is an issue with the Linux drivers. I'm pretty sure that the same program would work on Windows.
Laurent Gomila - SFML developer

lattyware

  • Newbie
  • *
  • Posts: 9
    • View Profile
RenderTexture and Multi-monitor setups.
« Reply #5 on: August 28, 2011, 10:55:17 pm »
Quote from: "Laurent"
SFML doesn't handle multi-monitors at the moment, so maybe it is an issue with the Linux drivers. I'm pretty sure that the same program would work on Windows.


It's possible - I'll try running the test under windows when I get the chance. That said, this is the only thing I've found that doesn't work under my multi-monitor setup, other video players, games and stuff work fine.

 

anything