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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - lattyware

Pages: [1]
1
Graphics / 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]

2
Python / PySFML2 Cython Text under Python 3
« on: July 22, 2011, 11:42:00 pm »
I'm running PySFML2-Cython under Python 3, appears to work alright, I'm poriting across a project that was using the old library, and the Text class that replaces the old String class is causing trouble.

I try and pass it a python3 str (unicode) and I get this error:

self.text = sf.Text(value)

  File "sf.pyx", line 1591, in sf.Text.__cinit__ (sf.cpp:17293)
TypeError: expected bytes, str found

I was under the impression that the Text class should have supported unicode, unlike everything else, but I tried it the other way, encoding it to bytes:

self.text = sf.Text(bytes(value, "UTF-8"))

  File "sf.pyx", line 1614, in sf.Text.__cinit__ (sf.cpp:17503)
TypeError: Expected str or unicode for string, got <class 'bytes'>

Is this something stupid I'm missing, or a problem with the bindings?

Pages: [1]
anything