i realize my sfml constantly growing memory usage even for simple rectangle drawing
aprox 1000k /sec
and wery soon get in task menegers top list off all apps runing on my pc
import sfml as sf
# create the main window
window = sf.RenderWindow(sf.VideoMode(640, 480), "pySFML Window")
def square(pos, angle,size):
sq=sf.graphics.RectangleShape()
sx=size.x
sy=size.y
sq.size=sf.Vector2(sx, sy)
sq.fill_color=sf.Color.RED
sq.rotation=angle
sq.position=pos
window.draw(sq)
sq=0
# start the game loop
while window.is_open:
# process events
for event in window.events:
# close window: exit
if type(event) is sf.CloseEvent:
window.close()
window.clear() # clear screen
square(sf.Vector2(10, 10),0,sf.Vector2(10, 10))
window.display() # update the window