Render PNG images using OpenGL in Haskell -
i new haskell , building chess game using opengl
(using graphics.ui.glut
) ui. trying render png images chess pieces.
i read images can converted textureobject
, rendered, not find helpful resources know how it.
this code looks generating chess board
drawsquare :: boardsquare -> io () drawsquare ((x,y,z),(r,g,b)) = preservingmatrix $ color $ color3 r g b translate $ vector3 x y z drawcube -- draw square of appropriate size -- display callback display :: ioref gamestate -> displaycallback display gamestate = gstate <- gamestate clear [colorbuffer] form_ (getboardpoints gstate) $ drawsquare -- drawing 64 squares here flush
can me render png image @ given x
, y
coordinates of window given file path?
suggestion: since new haskell, instead of diving straight raw opengl
chess game, have looked @ libraries make opengl
easier? recommend gloss , looks gloss-game has helper function load .png
file memory ready used game. luck! :-)
Comments
Post a Comment