1

我刚刚成功安装了 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),并且我Graphics.Rendering.OpenGL.GLdouble在我的 Haskell 代码中使用了该类型。

更多研究告诉我,类型 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 glut 2.2.2.0 和 ubuntu 11.04

这有发生在其他人身上吗?

4

1 回答 1

1

只是一个猜测,但略读https://bugs.freedesktop.org/show_bug.cgi?id=24226http://ubuntuforums.org/archive/index.php/t-333966.html听起来你可能会得到通过尝试不同的 GL[UT] 初始化参数得到结果。请参阅FunGEn 的 Graphics/UI/Fungen/Init.hsGLUT 的初始化 api。也许有 FunGENfunInit明确设置的间接模式:

initialize "FunGen app" ["-indirect"]
于 2011-09-02T22:13:31.670 回答