[Haskell-cafe] OpenGL Speed!

Eitan Goldshtrom thesourceofx at gmail.com
Thu Jul 29 05:57:05 EDT 2010


I'm having an unusual problem with OpenGL. To be honest I probably 
shouldn't be using OpenGL for this, as I'm just doing 2D and only 
drawing Points, but I don't know about any other display packages, so 
I'm making due. If this is a problem because of OpenGL however, then 
I'll have to learn another package. The problem is speed. I have a list 
of points representing the color of 800x600 pixels. All I'm trying to do 
is display the pixels on the screen. I use the following:

renderPrimitive Points $ mapM_ display list
flush
where
   display [] = return ()
   display ((x,y,i):n) = do
     color $ Color3 i i i
     vertex $ Vertex2 x y
     display n

But, for some reason this takes FOREVER. I don't know how to use 
debugging hooks yet without an IDE -- and I don't use an IDE -- but I 
used a cleverly placed putStrLn to see that it was actually working, 
just really really slowly. Is there a solution to this speed problem or 
should I use a package that's more suited to 2D applications like this? 
Also, if I should use another package, are there any suggestions for 
which to use? Thanks for any help.

-Eitan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100729/b34b3755/attachment.html


More information about the Haskell-Cafe mailing list