Perl 6 - the future is here, just unevenly distributed

IRC log for #sdl, 2014-10-14

| Channels | #sdl index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
03:42 kaare joined #sdl
05:19 kaare joined #sdl
07:13 dod joined #sdl
07:26 FROGGS_ joined #sdl
08:01 basiliscos joined #sdl
08:24 FROGGS joined #sdl
08:44 FROGGS joined #sdl
09:05 dod joined #sdl
11:05 dod joined #sdl
13:27 FROGGS joined #sdl
13:49 FROGGS joined #sdl
14:09 FROGGS joined #sdl
15:42 kaare joined #sdl
16:59 basiliscos joined #sdl
17:12 dod joined #sdl
17:32 basiliscos Hello.
17:33 basiliscos I'm trying to move from manual event cycle processing to more industrial-robost, i.e. to use SDLx::App
17:33 basiliscos I have tried  the following code http://pastebin.com/ZY60zJ2d
17:34 basiliscos - almost copied from documentation
17:34 basiliscos but it not exits, and eats 100% of one CPU core.
17:34 basiliscos What I'm doing wrong?
22:08 mtj hiya basiliscos, i'll take a look at your pastebin later today
22:09 mtj just doing some $job stuff, atm
22:10 basiliscos mtj: Thank you, friend.
22:11 basiliscos I think I already managed that: I should invoke  $app->update in show_handler
22:11 basiliscos and specify some value for "delay" in SDLx::Application constructor
22:12 basiliscos i defined the value 1000/60 (1 second divided to 60 FPS), and not it dont eats my CPU cycles
22:15 mtj ahh, good!
22:16 mtj yes, i had to play about with those settings too!
22:17 mtj also i use... $app->dt() and $app->min_t()
22:17 mtj ...to slowdown/speedup my game  loop, for debugging
22:20 mtj i now can get any frame rate i want under 60 fps - with low cpu usage
22:20 basiliscos I still not solved the following issue:
22:21 basiliscos I have an object rotations defined in time intervals like 0.5, 0.003 (seconds), etc.
22:22 basiliscos I have done that previously using AnyEvent, which sleeps appropriate amount of time, and only then rotates it
22:22 basiliscos How to do that with SDLx::Controller?
22:23 mtj hmm, off-my-head... i do not know :/
22:23 mtj that is something i have not done yet
22:24 basiliscos btw, what game do you develop?
22:26 mtj ...just some small 'toy' games, for learning game techniques
22:27 mtj ..in perl  :)
22:28 mtj perhaps you might need to use another module, like AnyEvent, or Time::HiRes ?
22:29 basiliscos I already used AE, and I've done hand-made loop
22:29 basiliscos but that was wrong way (at least for Loop)
22:30 basiliscos because it depended on hardware how fast my engine was
22:30 basiliscos But I used AE for playing scenario too.
22:31 basiliscos And may be there is some sense to leave it untouched :)
22:32 mtj ping kthakore_, any ideas on basiliscos question..? ^
22:35 basiliscos Direct way to implement that is to ask current_time at $app, and do object movement, when it's movement is between $last_time and $now
22:35 mtj yeah, thats what i think too ;)
22:36 mtj that should work ok
22:36 basiliscos Indirect way is to use AE, but to call AE core like AE::tick() (I can't remember the exact method) inside movement_ or event_callback
22:37 basiliscos and use AE as usual
22:38 mtj without AE is best... KISS
22:38 basiliscos :)
22:39 mtj FROGGS may have some good advice too... when he is online next
22:40 basiliscos But I think, that there is a minor drawback, that AE will be not exact, i.e. because it will be invoked not frequently then $delay
22:40 basiliscos mtj: Thank you
22:40 basiliscos I'm going to sleep, but tomorrow I'll ask Froggs

| Channels | #sdl index | Today | | Search | Google Search | Plain-Text | summary