[HOpenGL] Problem with Glut

Jason Dagit dagitj at gmail.com
Mon May 7 05:53:09 CEST 2012


On Sun, May 6, 2012 at 1: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.


Great!


> 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 would advise against using GLUT.  I recommend GLFW-b.  You can get it
from Hackage. I've tested it on Windows 7, OSX, and Linux. It should just
work out of the box.


>
>
> 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)
>

You need to find a copy of glut32.dll and put it into the same directory.
If you want to use GLUT, I would use the dll from freeglut. By the way, if
you want to use ghci with opengl you will need to start ghci with
-fno-ghci-sandbox.  Otherwise you will get weird crashes. This applies to
GLUT and GLFW-b equally.


>
> 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.
>

I would use GLFW-b.

You can find some example code for haskell opengl here:
https://github.com/dagit/nehe-tuts

That version uses openglraw and glfw-b. If you want to use the non-raw
version of the api look at this version in the history of the repo:
https://github.com/dagit/nehe-tuts/tree/447f5471f3e7fe07b44dc5d2d87c4a95be35ce75

I hope that helps,
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/hopengl/attachments/20120506/24df0ab4/attachment.htm>


More information about the HOpenGL mailing list