Hello Claude,
Hi Hector,[snip]
On 11/07/10 03:02, Hector Guilarte wrote:
> I've been looking for a way to map a texture into a Quad primitive with
> HOpenGL with no luck.
I'm having trouble understanding where your problem is.
There are three steps to texturing using an image file:
load :: FilePath -> IO Image -- read file to raw pixel buffer
upload :: Image -> IO TextureObject -- upload to graphics card
draw :: TextureObject -> IO () -- use the texture on something
where
data Image = Image{ width, height, channels :: Int, pixels :: Ptr () }
Which step is problematic?
'load' is the hardest IMO, and doesn't have anything to do with OpenGL.
'upload' I would implement with 'build2DMipmaps'
'draw' is easy: bind the texture, add a 'texCoord' before each 'vertex'
I could provide some example code for 'upload' and 'draw' if you think it would help.
Claude
--
http://claudiusmaximus.goto10.org
_______________________________________________
HOpenGL mailing list
HOpenGL@haskell.org
http://www.haskell.org/mailman/listinfo/hopengl