[Haskell-cafe] a textured quad/triangle

10 views
Skip to first unread message

Vlad Lopatin

unread,
Oct 21, 2014, 6:24:40 AM10/21/14
to Haskell-Cafe
Hello,

I am looking for a working example of texture binding, using VBOs and OpenGL4+ standard.  A textured quad/triangle would be great.  Does anybody have one?


Regards,
Vlad

Oliver Charles

unread,
Oct 21, 2014, 7:13:05 AM10/21/14
to Vlad Lopatin, Haskell-Cafe
During 24 Days of Hackage last year, I wrote some basic code to get a spinning triangle on screen, using VBOs and shaders. You can find the code for this at https://github.com/ocharles/blog/blob/master/code/2013-12-02-linear-example.hs.

To do texturing, it's not much more complicated. My toy "hadoom" project (a Doom-like engine in Haskell) uses texturing - but obviously there's more code to wade through there. I think the relevant stuff will be


You'll have to do some grep'ing to see how it all fits together. You'll also need to add UV coordinates to the triangle.

Hope this provides enough information to help you get started. If you're comfortable on IRC, you might want to swing by #haskell-game on Freenode, where we're trying to build a Haskell game/graphics dev community.
- ocharles

_______________________________________________
Haskell-Cafe mailing list
Haskel...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Vlad Lopatin

unread,
Oct 22, 2014, 5:19:50 PM10/22/14
to Oliver Charles, schell....@synapsegroup.com, Haskell-Cafe
Thank you, Oliver and Schell,

Thanks to combined wisdom of both of you, I was able to produce the following thing:



I hope, when finished, some future noob may find it helpful.
Cheers,
Vlad
Reply all
Reply to author
Forward
0 new messages