Questions tagged [gloss]

The Haskell gloss package is a simple vector graphics drawing package.

Source

Gloss hides the pain of drawing simple vector graphics behind a nice data type and a few display functions. Gloss uses OpenGL under the hood, but you won't need to worry about any of that. Get something cool on the screen in under 10 minutes.

102 questions
2
votes
0 answers

Using makeLens with Gloss gives "can't load framework: OpenGL (not found)"

System: Mac OS X Big Sur ghc : 8.8.4 cabal: 3.2.0.0 I can install all gloss-examples and run without issues. But when I use makelens ''Foo It suddenly complains: : can't load framework: OpenGL (not found) I tried with microlens and…
daydaynatation
  • 550
  • 2
  • 8
2
votes
0 answers

I can't install the library gloss, in Mac OS Catalina (Haskell)

I am trying to install the Haskell gloss library, on Mac OS Catalina, but I have a lot of problems. I download the tar.gz file from that page. The first thing I did was follow this steps to install Haskell. Already with cabal installed (the…
Marcos
  • 159
  • 1
  • 1
  • 8
2
votes
0 answers

How do I draw the bounding rectangle of a Picture in gloss?

Is there a function in gloss that, given a Picture returns the width, height and coordinates of the smallest rectangle that encloses the Picture? If not, is it possible to write one?
user1023733
  • 805
  • 5
  • 14
2
votes
1 answer

Haskell Gloss - Do something every frame key is pressed

I want to move an object in Haskell Gloss every frame a key is pressed, not just the one frame that the key is started being pressed. (Example: While 'w' key is pressed, accelerate object every frame) Edit: I tried using the second parameter of…
The Coding Wombat
  • 805
  • 1
  • 10
  • 29
2
votes
2 answers

Exception: user error (unknown GLUT entry glutInit) on ubuntu

i keep getting this error when trying to use gloss on ubuntu. this is my code. import Graphics.Gloss main :: IO () main = display window background drawing where window = InWindow "Nice Window" (200, 200) (0, 0) background = white…
2
votes
0 answers

React to Shift+Tab in Gloss

I am currently writing a game using gloss' play. The basic structure of this game is very simple: I have a board with units on it, one of which is in focus. I have added the ability to change the focus by cycling through the units on the board using…
gallais
  • 11,823
  • 2
  • 30
  • 63
2
votes
1 answer

Problems installing Haskell on Yosemite (specifically the gloss library)

I have spent an evening until some ridiculous time in the morning trying to figure out how to get Haskell's GHC to work correctly and to have Cabal install the gloss library. After reading through every bit of documentation/error reports…
Nate Uni
  • 933
  • 1
  • 12
  • 26
2
votes
1 answer

Profiling options not working with gloss

Profiling options aren't working with gloss, even though gloss was installed with library profiling enabled in ~/.cabal/config, Example: Test.hs import Graphics.Gloss main = display (InWindow "test" (800, 600) (200, 200)) black blank Compiling and…
mcjohnalds45
  • 667
  • 1
  • 8
  • 16
2
votes
0 answers

Haskell thread doesn't die

I'm using gloss to display something, while at the same time using forkOS $ system "mpg123 foo.mp3" >> return () to play some audio in the background. When I close the gloss window, the program exits, but the audio keeps playing. All resources show…
Vlad the Impala
  • 15,572
  • 16
  • 81
  • 124
2
votes
1 answer

What combination of libraries to provide 2-D graphics, optionally in webapp? (Haskell)

I am building a simple interactive program with 2D-graphics, and I'd like to know which combination of Haskell libraries are likely to work. My requirements and ideas-so-far are below: Fundamental requirements: Simple 2-D geometric drawing, of the…
misterbee
  • 5,142
  • 3
  • 25
  • 34
1
vote
1 answer

Space Leak on Gloss render of Mutable Image

I used the JuicyPixel library for generating a rendered image and the gloss library for a live preview. The piece of code below causes a Space Leak viewportRenderer :: Viewport Picture viewportRenderer = do eventText <- Color [rgb|#FFFFFF|] .…
Perigord
  • 111
  • 6
1
vote
1 answer

Drawing bitmap to screen Gloss Haskell

For uni I have this assignment where I need to code a simple game, im now having issues with drawing the player object to the screen. I have the following functions: data Player = MkPlayer { playerpos :: Point, …
Jord van Eldik
  • 351
  • 2
  • 10
1
vote
1 answer

How to load array of images in haskell(gloss)?

I am very new to Haskell and do not have good understanding of monads for now. I am using gloss for making chess. The issue I am facing is in the loading of multiple images. I am using loadBMP function provided by haskell to load image. Its…
Maheer Ali
  • 35,834
  • 5
  • 42
  • 73
1
vote
0 answers

Haskel - Gloss: Tile Sheet (or how to extract areas from a picture)

I'm currently working on a tile-based 2d engine for Haskell. So my current task is to extract(=import) sections of a picture. I am using from Graphics.Gloss.Data.Picture bitmapSection :: Rectangle -> BitmapData -> Picture My Problemm is as…
Thomas Meyer
  • 384
  • 1
  • 11
1
vote
1 answer

How to use gloss accelerate to render mandelbrot

as an exercise I'm trying to render the Mandelbrot set using Haskell. I'm using gloss to display the result. So far I got the math correct, and displaying works. At the moment I generate a [[Word8]] which represents the iterations it took for each…
Modi57
  • 205
  • 1
  • 10