Custom Query (25 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (1 - 3 of 25)

1 2 3 4 5 6 7 8 9
Ticket Resolution Summary Owner Reporter
#15 worksforme Window doesn't refresh under Gnome. Ben Lippmeier
Description

I tried this in a typical Gnome environment, but the window never refreshed and X hogged 100% of the CPU.

{-# LANGUAGE CPP #-}
import Graphics.Gloss.Game
import Graphics.Gloss
import Data.Maybe (maybe)
import Debug.Trace

main = do
      let state = St Nothing []
      gameInWindow "Test Game" (1400,1050) (0,0) white 100 state makePicture handleEvent stepWorld

data State = St (Maybe Path) [Picture]
type Segment = ((Float, Float), (Float, Float))

makePicture :: State -> Picture
makePicture (St m xs) = Pictures (maybe xs (\x -> Line x : xs) m)

handleEvent :: Event -> State -> State
handleEvent e st = trace (show e) (handleE e st)

handleE (EventMotion (x,y)) st@(St (Just ps) ss) = St (Just ((x-418,516 - y):ps)) ss -- Here is the offset for a 1/2 window on xmonad
handleE (EventKey (MouseButton LeftButton) Down _ pt@(x,y)) st@(St Nothing ss) = St (Just [pt]) (Translate x y (Text "Down") : ss)
handleE (EventKey (MouseButton LeftButton) Up _ pt@(x,y)) st@(St (Just ps) ss) = St Nothing (Translate x y (Text "up") : Line (pt:ps) : ss)
handleE _ st = st

stepWorld :: Float -> State -> State
stepWorld _ = id
#35 fixed Space leak in timing code Ben Lippmeier
Description

This program leaks 25k/sec

module Main (
    main
)
where

import Graphics.Gloss
import Graphics.Gloss.Interface.IO.Game

main = 
    playIO (InWindow "glossmem" (500, 500) (0,0)) white 10 0
    (\world -> return (translate (-250) 0 (text $ show world)))
    (\event -> (\world -> return world))
    (\timePassed -> (\world -> return $ world + timePassed))
#36 wontfix Gloss crashes in GHCi under Mountain Lion Ben Lippmeier
Description

This crashes with but GLUT and GLFW with and without -fno-ghci-sandbox.

1 2 3 4 5 6 7 8 9
Note: See TracQuery for help on using queries.