Re: Problem with Glut

Jason Dagit <[email protected]> Sun, 6 May 2012 20:53:09 -0700
Newsgroups gmane.comp.lang.haskell.hopengl
Message-ID <CAJ-DSyxxxAW_9rKs=zN=e=imgb+SyPCk5E4wYLZb3im_wdxGDQ@mail.gmail.com>
--===============6744131704423965237==
Content-Type: multipart/alternative; boundary=f46d043890f55d4dca04bf6a3583

--f46d043890f55d4dca04bf6a3583
Content-Type: text/plain; charset=ISO-8859-1

On Sun, May 6, 2012 at 1:34 PM, ai00rea <[email protected]> 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

--f46d043890f55d4dca04bf6a3583
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">On Sun, May 6, 2012 at 1:34 PM, ai00rea =
<span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_=
blank">[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D=
"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding=
-left:1ex">
I have to make a project for university. I want to make a little game like<=
br>
Pong.</blockquote><div><br></div><div>Great!</div><div>=A0</div><blockquote=
 class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc soli=
d;padding-left:1ex"> For this I decided to use Glut. I followed this tutori=
al but I didn&#39;t<br>

succeed: <a href=3D"http://netsuperbrain.com/blog/posts/freeglut-windows-ho=
pengl-hglut/" target=3D"_blank">http://netsuperbrain.com/blog/posts/freeglu=
t-windows-hopengl-hglut/</a></blockquote><div><br></div><div>I would advise=
 against using GLUT. =A0I recommend GLFW-b. =A0You can get it from Hackage.=
 I&#39;ve tested it on Windows 7, OSX, and Linux. It should just work out o=
f the box.</div>
<div>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
I am using Windows 7. Now I removed all things I installed from my computer=
<br>
about haskell &amp; openGL &amp; GLUT.<br>
And I installed Haskell Platform. I found out that openGL and GLUT are<br>
included in this platform. OK but there is one problem:<br>
<br>
<br>
GHCi, version 7.0.4: <a href=3D"http://www.haskell.org/ghc/" target=3D"_bla=
nk">http://www.haskell.org/ghc/</a> =A0:? for help<br>
Loading package ghc-prim ... linking ... done.<br>
Loading package integer-gmp ... linking ... done.<br>
Loading package base ... linking ... done.<br>
Loading package ffi-1.0 ... linking ... done.<br>
[1 of 1] Compiling Main =A0 =A0 =A0 =A0 =A0 =A0 (<br>
C:\Users\fuRy\Desktop\openGL\teapots.hs, i<br>
nterpreted )<br>
Ok, modules loaded: Main.<br>
*Main&gt; main<br>
Loading package OpenGL-2.2.3.0 ... linking ... done.<br>
Loading package array-0.3.0.2 ... linking ... done.<br>
Loading package containers-0.4.0.0 ... linking ... done.<br>
Loading package GLUT-2.1.2.1 ... &lt;interactive&gt;: glut32: The specified=
 module<br>
cou<br>
ld not be found.<br>
can&#39;t load .so/.DLL for: glut32 (addDLL: could not load DLL)<br></block=
quote><div><br></div><div>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. =A0Otherwise you will get weird crashes.=
 This applies to GLUT and GLFW-b equally.</div>
<div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex=
;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Please help me. I tried 2 days to install this. Before that I tried to<br>
instal WXHaskell too, and i failed. Or recomand me an library that you use<=
br>
and there are some examples of code to figure out how to use it and is good=
<br>
for my purpose: Pong.<br></blockquote><div><br></div><div>I would use GLFW-=
b.</div><div><br></div><div>You can find some example code for haskell open=
gl here:=A0<a href=3D"https://github.com/dagit/nehe-tuts">https://github.co=
m/dagit/nehe-tuts</a></div>
<div><br></div><div>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 t=
he repo:=A0<a href=3D"https://github.com/dagit/nehe-tuts/tree/447f5471f3e7f=
e07b44dc5d2d87c4a95be35ce75">https://github.com/dagit/nehe-tuts/tree/447f54=
71f3e7fe07b44dc5d2d87c4a95be35ce75</a></div>
<div><br></div><div>I hope that helps,</div><div>Jason</div></div>

--f46d043890f55d4dca04bf6a3583--


--===============6744131704423965237==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
HOpenGL mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/hopengl

--===============6744131704423965237==--