does pyglet.clock.set_fps_limit work in 1.2alpha?

67 views
Skip to first unread message

Winston Wolff

unread,
Jan 18, 2013, 6:44:57 PM1/18/13
to pyglet...@googlegroups.com
Does setting an FPS limit work in 1.2alpha? I have a cocos2d app and it runs about 40fps normally, but when the window gets covered by another window, the fps jumps up to 200fps and it starts using a lot of CPU. I don't like that CPU usage so I'm trying to set a max framerate of 30. But none of these calls seem to do anything, i.e framerates will still be about 45 when showing, and 200 when the window is obscured:

pyglet.clock.set_fps_limit(30.0)
pyglet.clock.get_default().set_fps_limit(30)
cocos.director.event_loop.clock.set_fps_limit(30)

Running Mac OS X 10.8.2


Winston Wolff
Stratolab - Games for Learning
tel: (917) 543 8852
web: www.stratolab.com

Andre D

unread,
Jan 18, 2013, 8:04:43 PM1/18/13
to pyglet...@googlegroups.com
Rearrange your event loop to use clock.schedule_interval(update,
1/60.0) and call draw from within there.
> --
> You received this message because you are subscribed to the Google Groups "pyglet-users" group.
> To post to this group, send email to pyglet...@googlegroups.com.
> To unsubscribe from this group, send email to pyglet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.
>

Peter Enerccio

unread,
Jan 18, 2013, 10:33:04 PM1/18/13
to pyglet...@googlegroups.com
Or just write your own even loop, which is always the best imho.


2013/1/19 Andre D <an...@andred.ca>



--
Bc. Peter Vaňušanik
http://www.bishojo.tk
Reply all
Reply to author
Forward
0 new messages