[reactive] Re: Link to Tetris

Thomas Davie tom.davie at gmail.com
Tue Dec 16 05:41:14 EST 2008


On 16 Dec 2008, at 11:36, Claus Reinke wrote:

>>>> http://code.haskell.org/~wchogg/Tetris.hs
>>> But when I try to run it, it exits immediately, without any message
>>> or window, let alone any animations..
>>
>> That seems to be an issue when starting from within cygwin's bash.
>> Starting from cmd, or by double-clicking, works. Since I don't
>> have this issue with other OpenGL code, it must be built into
>> reactive somewhere?
>>
>> The result appears very sluggish: when I do nothing, the ticks
>> don't seem to come evenly, and when I try to move pieces,
>> keyboard input and movement are out of sync by the second
>> piece, with reactions happening very late (perhaps for the next
>> piece instead of the current one), or seemingly not at all. I
>> assume that is not an expected feature?-)
>
> Seems to be partially timer- and partially event-merge-related:
> if I compile with -threaded, the pieces do not move at all on their
> own, but as long as I keep pressing "down", the game appears
> playable as intended; if I compile without -threaded, the pieces
> move occasionally, but the effects of keyboard input are entirely
> unpredictable.

I've noticed this behavior in since the last couple of days, So at a  
guess a bug got introduced somewhere along the line.  The merge issue  
is known -- at the moment, an occurrence doesn't appear in the output  
until it's known whether or not the other event ever occurs, which  
isn't ideal.  Unfortunately, the obvious fix for the issue creates a  
large memory leak, I've been playing with a few ways to fix this.

Tom Davie


More information about the Reactive mailing list