#42 InitDisplayMode(GLUT_ALPHA)

closed-fixed
nobody
critical (31)
7
2005-01-03
2004-04-26
James Fung
No

Hi,

I've tried two programs which use:
glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA |
GLUT_ALPHA);
When calling glutCreateWindow, the inclusion of
GLUT_ALPHA above gives:

freeglut_window.c:300: fgOpenWindow: Assertion
`window->Window.VisualInfo != ((void *)0)' failed.

I've had this happen on my own program, as well
as on the nvidia cg_brush demo (from their website).

I'd be happy to give you any additional information
which might help.

Thanks.

Discussion

  • Richard Rauch

    Richard Rauch - 2004-05-03

    Logged In: YES
    user_id=854844

    Hi.

    Can you please give an explicit, complete example that exhibits
    this problem? (Preferably one that you wrote yourself and which
    is minimal? But also, one which we have the legal right to modify
    and redistribute?)

    I cannot cause this behavior in OpenGLUT, and OpenGLUT
    should have the same behavior as freeglut re. most display
    modes.

    I do not have the nVidia cg_brush demo handy. I could go digging
    around for it, but it would be easier if you could provide a
    sample of code.

    Thanks.

     
  • Richard Rauch

    Richard Rauch - 2004-05-03

    Logged In: YES
    user_id=854844

    Oh, and could you be explicit about what you are using?

    Which version of freeglut?
    Which OS (and which version)?

    ...and does the old Mark Kilgard GLUT library work correctly?

    Thanks.

     
  • James 'J.C.' Jones

    • labels: --> critical
    • priority: 5 --> 7
     
  • James Fung

    James Fung - 2004-05-03

    Logged In: YES
    user_id=189262

    Hi,

    I'm using Linux 2.6.5, /usr/lib/libglut.so.3.8.0

    Yes, i tried the other GLUT library (from the Debian
    'testing' distribution), and it gave me something like
    "could not find suitable visual" and then exits. After
    checking, I realized my X was set to 16bpp. I set it to
    "DefaultDepth 24" and the programs work fine now, under both
    that and freeglut.

    So, likely this behaviour can be recreated by setting the
    wrong bit depth on X.

    It might then just be more of a 'non graceful' error message
    than a bug

    I'll send it a bit of code in a little while too for you.

    Thanks.

     
  • Richard Rauch

    Richard Rauch - 2004-05-03

    Logged In: YES
    user_id=854844

    Thanks for the followup.

    Yes, freeglut uses the assert() macro in a *lot* of places where
    it should do more of an if(...). This is sub-optimal (not least
    because if you ever compile it with the suitable compiler
    options, the assert() tests will simply vanish and the program will
    probably crash in nasty ways when ``normal'' things like this
    happen).

    Thanks for the information. A sample program wouldn't hurt,
    though at this point I think you're right that it's just a non-graceful
    failure and any freeglut-using program would have that
    problem if the implied X visual were not available.

     
  • Richard Rauch

    Richard Rauch - 2004-10-08

    Logged In: YES
    user_id=854844

    For the record, OpenGLUT has substantially cleaned up the use
    of assert(). Where it is still appropriate, assert() is
    still used. Where other mechanisms are more appropriate,
    they are used instead. In OpenGLUT, an assert() should only
    be used to test logical errors in the library, rather than
    checking resource allocations and client application
    correctness.

    When the topic was raised on the freeglut list, the view
    offered by most members was that assert() should be retained.

    This won't affect anything other than how crypting the error
    messages are.

     
  • Sven Panne

    Sven Panne - 2005-01-03

    Logged In: YES
    user_id=50298

    This has been fixed now, and the message (for X11-based systems)
    reads something like this:

    freeglut (aaindex): ERROR: Internal error <Visual with
    necessary capabilities not found> in function fgOpenWindow

     
  • Sven Panne

    Sven Panne - 2005-01-03
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks