[Haskell-cafe] need help please [HOpenGL]

Brian Hulley brianh at metamilk.com
Sat Apr 22 20:42:08 EDT 2006

Hi -
You could try something like:

import Foreign.Ptr
import Foreign.C.String

bmp <- withCAString "C:\1.bmp" $ bitmap (Size (100,100)) (Vertex2 0 0) 
(Vertex2 0 0)

and if that doesn't work try withCString or withCWString. I'm assuming that 
the Ptr a in the docs is supposed to be a pointer to a null terminated C 
string hence withCAString should hopefully work.
I'd also compile with -fffi (if you're using ghc)

(I haven't tried it myself so someone else might have a better answer)

Regards, Brian.

----- Original Message ----- 
From: enache alex
To: haskell-cafe at haskell.org
Sent: Saturday, April 22, 2006 11:10 PM
Subject: [Haskell-cafe] need help please [HOpenGL]

hello ; I am writing to ask you a thing ; I am writing a little game on 
Haskell's HOpenGL ; the game isn't much , but I want to make look a little 
better ; and for that I want to use bitmaps (or textures) ; I don't know 
very much about this subject ; I've tried to use de bitmap function from 
Graphics.Rendering.OpenGL.GL.Bitmap , but i gives me an error ; I've used 
the function like this ;
bmp <- bitmap (Size (100,100)) (Vertex2 0 0 ) (Vector2 0 0 ) (Ptr 
end it tells me that he doesn't find the Ptr constructor ; if you can supply 
an full example on this matter it would great ; many thanks ; hope to hear 
from you soon ; thanks for your time in reading my letter ;
PS : the example doesn't have to be big , it just has to contain all the 
things , in order for me not to miss something

Haskell-Cafe mailing list
Haskell-Cafe at haskell.org

More information about the Haskell-Cafe mailing list