开发者

FunGen in Ubuntu

I've just installed Ubuntu succesfully, mainly to make it easier to work Haskell libraries than in Windows.

When I run some Haskell code I was working on, it just knocks my socks off. I'm using FunGen libraries for my game and I got this error when I tried to run it.

freeglut (FunGen app):  ERROR:  Inter开发者_JAVA技巧nal 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

After some web searching, I found a way to fix this in C code, (using GlutDouble instead of GlDouble), and I am using the type Graphics.Rendering.OpenGL.GLdouble in my Haskell code.

a liitle more research told me that type GlDouble = Double, so , this isn't the cause, in addition, i just took off the gldouble part in code and still it does not work. So, here is some simple code that drive me to the previous error:

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

about versions, ive got : freeglut3 2.6.0-1ubuntu2, ghc 6.12.3, fungen 0.3 ,haskell glut 2.2.2.0 and ubuntu 11.04

Has this happened to anyone else?


Just a guess, but skimming https://bugs.freedesktop.org/show_bug.cgi?id=24226 and http://ubuntuforums.org/archive/index.php/t-333966.html makes it sound like you might get results by trying different GL[UT] initialization parameters. See FunGEn's Graphics/UI/Fungen/Init.hs, and GLUT's initialization api. Maybe have FunGEn's funInit explicitly set indirect mode:

initialize "FunGen app" ["-indirect"]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜