Haskell Android OpenGL

我一直在使用Ajhc跟踪OpenGL中的2D对象。

我不知道如何跟踪我的对象,并防止它离开设备的宽度和高度。 任何人都可以提供援助

我的代码在这里:

module Draw where import CubeVerts import CoSys import AndroidNdk import AndroidNdk.Log import Foreign.Marshal.Array spriteMv :: Float -> Float -> Float -> Float -> Float -> IO () spriteMv xy dx dy z = do drawFunc drawFunc :: IO () drawFunc = do c_glDrawArrays c_GL_TRIANGLES 0 6 spritePlayer :: Float -> Float -> Float -> Float -> Float -> IO () spritePlayer xy dx dy z = do withArray vertices $ λvp -> withArray colors $ λcp -> do c_glEnableClientState c_GL_VERTEX_ARRAY c_glEnableClientState c_GL_COLOR_ARRAY c_glVertexPointer 3 c_GL_FLOAT 0 vp c_glColorPointer 4 c_GL_FLOAT 0 cp spriteMv xy dx dy z c_glDisableClientState c_GL_VERTEX_ARRAY c_glDisableClientState c_GL_COLOR_ARRAY 

Solutions Collecting From Web of "Haskell Android OpenGL"