在Ubuntu的FunGen

时间:2011-09-02 03:46:49

标签: haskell ubuntu freeglut

我刚刚成功安装了Ubuntu,主要是为了让Haskell库比在Windows中更容易。

当我运行一些我正在处理的Haskell代码时,它只是敲掉了我的袜子。我正在为我的游戏使用FunGen库,当我尝试运行它时出现了这个错误。

freeglut (FunGen app):  ERROR:  Internal error <FBConfig with necessary capabilities nt found> in function fgOpenWindow
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  4 (X_DestroyWindow)
  Resource id in failed request:  0x0
  Serial number of failed request:  33
  Current serial number in output stream:  36

经过一些网络搜索,我发现了一种在C代码中修复此问题的方法,(使用GlutDouble代替GlDouble),我在Haskell代码中使用了类型Graphics.Rendering.OpenGL.GLdouble

更多的研究告诉我,类型GlDouble = Double,所以,这不是原因,此外,我刚刚在代码中取消了gldouble部分,但仍然无效。 所以,这里有一些简单的代码可以解决上一个错误:

module Main where
import Graphics.UI.Fungen
width, height :: Int
width = 600
height = 400
w = fromIntegral width
h = fromIntegral height

main :: IO ()
main = do
    let winConfig = ((200, 200), (width, height), "game");
        gameMap = (textureMap 0 w h w h);
    funInit winConfig gameMap [] () () [] gameCycle (Timer 30) []
gameCycle :: IOGame () () () () ()
gameCycle = do  
            showFPS TimesRoman24 (w-40,0) 1.0 0.0 0.0

关于版本,我得到:freeglut3 2.6.0-1ubuntu2,ghc 6.12.3,fungen 0.3,haskell过剩2.2.2.0和ubuntu 11.04

这是否发生在其他人身上?

1 个答案:

答案 0 :(得分:1)