z0w0 / helm

A functionally reactive game engine, with headgear to protect you from the headache of game development provided.
http://helm-engine.org/
MIT License
600 stars 69 forks source link

Lines don't draw #42

Closed arianvp closed 10 years ago

arianvp commented 10 years ago

I've extended the demos/gradient to also draw a line. In elm it seemed to work as expected, but in helm it doesnt draw the line. This seems like a bug to me, but correct me if I'm wrong.

render :: Time -> (Int,Int) -> Element
render _ (w,h) = collage w h [ move (250,150) $ gradient linearGrad
                                              $ rect 300 100
                             , move (500,500) $ gradient radialGrad
                                              $ circle 64
                             , move (10,10)   $ traced (solid red) $ segment (0,0) (300, 100)]
funrep commented 10 years ago

Can you please provide linearGrad and radialGrad so we can reproduce the bug? Also, which example to be precise and what version of Helm are you using?

arianvp commented 10 years ago

demo : https://github.com/z0w0/helm/blob/master/demos/gradients/Main.hs

it isn't a problem with the gradients though because this doesn't draw the line either:

render  (w,h) = collage w h [ traced (solid red) $ segment (0,0) (300, 100) ]

main = run $ (lift render) <~  Window.dimensions

Helm 0.4

I'm on Elementary OS Luna. (Which has an exotic window manager, so I thought maybe that is the cause)

Once I am home I can dump more specs like library version of cairo etc etc.

funrep commented 10 years ago

I could not reproduce the bug in 0.5. I'm running Ubuntu 13.04. The examples are written for 0.5 on the website and in the repo, could you please try to reproduce this using that version?

I've hard to believe the window manager can cause the problem. Could you please tell what version of Ubuntu your distribution is based on so we see what version of cairo etc. you are using?

As for the examples, I honestly think they should link to the example directory and not the files directly since then you see the cabal files and notice that they are using 0.5.

BTW: Your code doesn't type check.

lift :: (a -> b) -> SignalGen (Signal a) -> SignalGen (Signal b)
(<~) :: (a -> b) -> SignalGen (Signal a) -> SignalGen (Signal b)

Here is a correct version.

render (w,h) = collage w h [ traced (solid red) $ segment (0,0) (300, 100) ]
main = run $ lift render Window.dimensions
arianvp commented 10 years ago

Yes sorry. quickly wrote that code on my mobile phone. Once I'm home I will give you details on my OS version etc. I will also check if I can reproduce it on 0.5

z0w0 commented 10 years ago

Line drawing was completely broken in 0.4. I will probably release 0.5 ASAP rather than hold it up on NY SDL2 port.

z0w0 commented 10 years ago

Is this fixed in 0.5?

arianvp commented 10 years ago

Yes. fixed in 0.5. Can close this.