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.


Messages - Tljjz

Pages: [1]
1
Python / Re: Script crashes on exit (sf.RenderWindow, sf.Texture)
« on: November 04, 2013, 07:57:59 pm »
I tried reinstalling pySFML 1.3 before and nothing changed. Also, maybe the issue happens only on Windows 7 32-bit?

But today I ran the script and it closed correctly, so I ran it a few more times and now it again crashes every time.  ???
Maybe it's just some crazy Windows magic on my computer.  :-X

The crash looks like this:
The script runs correctly until the window.close() line and then pauses (no errors or exceptions) and after a few seconds Windows shows the window saying that python.exe has stopped working (but the python console window isn't frozen, I can drag or resize it and the cursor is blinking).

The examples pong, shader and spacial_music also crash on exit, but pong crashes only when exiting during the game, never on the screen saying 'Press space to start the game'.

Looks like there's something wrong with window.close(), because the crash happens when the line window.close() is executed (in the examples or in my scripts) and never when I close the the script by the python console window.
Maybe it does something wrong with other resources, because
import sfml as sf
window = sf.RenderWindow(sf.VideoMode(640, 480), 'test')
window.close()
doesn't crash.

2
Python / Re: Script crashes on exit (sf.RenderWindow, sf.Texture)
« on: November 03, 2013, 06:48:22 pm »
I use pySFML 1.3.
I hope a fixed version will be possible to download from the website soon, because I noticed that some of the examples also crash on exit.

3
Python / Re: Sprite.position read-only?
« on: November 02, 2013, 09:55:35 pm »
It works if you write it like this:
sprite.position = (300, sprite.position.y)

Most likely sprite.position.x decodes the x coordinate from the sf.Transform (sf.Sprite inherits sf.Transformable which is a wrapper around sf.Transform) and returns it. So it's not a bug in pySFML, but simply the way SFML works.

4
Python / Script crashes on exit (sf.RenderWindow, sf.Texture)
« on: November 02, 2013, 02:57:34 pm »
I think I've found a bug in (py)SFML or Python 3.3.
When I run this code (it looks strange, but this is what remained after removing everything that didn't cause the crash):
import sfml as sf

window = sf.RenderWindow(sf.VideoMode(640, 480), 'test')

texture = sf.Texture.from_file('map.png')

window.close()
print('test')
the whole script executes, prints 'test' and then Windows shows a window saying that python.exe has stopped working. However, it doesn't crash in the IDLE python shell, only when I run the script directly.

Deleting the texture before the window is closed fixes everything:
import sfml as sf

window = sf.RenderWindow(sf.VideoMode(640, 480), 'test')

texture = sf.Texture.from_file('map.png')

del texture

window.close()
Looks like the crash is caused by the texture not being deleted before the window is closed.  :o

And this code:
import sfml as sf

window = sf.RenderWindow(sf.VideoMode(640, 480), 'test')

texture = sf.Texture.from_file('map.png')

window.close()
print('test1')
del texture
print('test2')
prints 'test1' and crashes like the first snippet, but unlike the first one it doesn't run fine in IDLE (it enters an infinite loop after print('test1')).

Pages: [1]