[HOpenGL] Problem with Glut

Balazs Komuves bkomuves at gmail.com
Mon May 7 09:46:42 CEST 2012


Hello,

Compiling the Haskell OpenGL/GLUT bindings on Windows is unfortunately very
complicated,
because they use some Unix tools. It is recommended to use the Haskell
Platform instead,
which as you noticed, has them included. If for some reasons you need to
compile them manually,
the primary trick is to install a (recent version!) of MinGW/MSys, which
provides the necessary
unixy tools.

I have more experience with GLUT than with GLFW, so I can add that GLUT
works pretty
robustly too (I use Windows and OSX), even though it clearly shows the age.
The only big
problem I remember is with the middle mouse buttons; and there is some
inconvenience
with the initialization, and lack of vsync support (which has to be hacked
in). However,
it provides a display callback, which as far as I remember, GLFW does not
(it only has
a big loop).

As Jason said, to use GLUT, you need to put glut32.dll at a place where
Windows finds it
(either at the same directory your executable is - recommended if you
distribute your app -,
or some Windows system directory).

Also, with GHCi there are some issues, so first try the compiled version.
I'm not up-to-date
regarding how to solve these issues.

OpenGL/GLUT is much simpler than wxHaskell. I had very bad experiences with
wxHaskell
(though I believe they were primarily caused by wx itself), but that was
some time ago, so it
is possible that it is better now.

Hope this helps,
Balazs


On Sun, May 6, 2012 at 10:34 PM, ai00rea <black_fury91 at yahoo.com> wrote:

> I have to make a project for university. I want to make a little game like
> Pong. For this I decided to use Glut. I followed this tutorial but I didn't
> succeed:
> http://netsuperbrain.com/blog/posts/freeglut-windows-hopengl-hglut/
>
> I am using Windows 7. Now I removed all things I installed from my computer
> about haskell & openGL & GLUT.
> And I installed Haskell Platform. I found out that openGL and GLUT are
> included in this platform. OK but there is one problem:
>
>
> GHCi, version 7.0.4: http://www.haskell.org/ghc/  :? for help
> Loading package ghc-prim ... linking ... done.
> Loading package integer-gmp ... linking ... done.
> Loading package base ... linking ... done.
> Loading package ffi-1.0 ... linking ... done.
> [1 of 1] Compiling Main             (
> C:\Users\fuRy\Desktop\openGL\teapots.hs, i
> nterpreted )
> Ok, modules loaded: Main.
> *Main> main
> Loading package OpenGL-2.2.3.0 ... linking ... done.
> Loading package array-0.3.0.2 ... linking ... done.
> Loading package containers-0.4.0.0 ... linking ... done.
> Loading package GLUT-2.1.2.1 ... <interactive>: glut32: The specified
> module
> cou
> ld not be found.
> can't load .so/.DLL for: glut32 (addDLL: could not load DLL)
>
>
> Please help me. I tried 2 days to install this. Before that I tried to
> instal WXHaskell too, and i failed. Or recomand me an library that you use
> and there are some examples of code to figure out how to use it and is good
> for my purpose: Pong.
>
> --
> View this message in context:
> http://haskell.1045720.n5.nabble.com/Problem-with-Glut-tp5689667.html
> Sent from the Haskell - HOpenGL mailing list archive at Nabble.com.
>
> _______________________________________________
> HOpenGL mailing list
> HOpenGL at haskell.org
> http://www.haskell.org/mailman/listinfo/hopengl
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/hopengl/attachments/20120507/0160e6c9/attachment.htm>


More information about the HOpenGL mailing list