Nifty-GUI is using deprecated OpenGL functions?

Sarge
2012-12-07
2013-03-21
  • Sarge
    Sarge
    2012-12-07

    If I use this kind of lwjgl Display startup:

    val contextAtrributes = new ContextAttribs(3, 2)
    contextAtrributes.withForwardCompatible(true)
    contextAtrributes.withProfileCore(true)
    Display.create(new PixelFormat(), contextAtrributes)
    

    Nifty-GUI fails with exception

    "java.lang.IllegalStateException: Function is not supported"
        at org.lwjgl.BufferChecks.checkFunctionAddress(BufferChecks.java:58)
        at org.lwjgl.opengl.GL11.glGenLists(GL11.java:1392)
        at de.lessvoid.nifty.renderer.lwjgl.render.font.Font.initDisplayList(Font.java:91)
    

    Is it normal? If it is, is there any way to permit using deprecated functions only within Nifty, but forbid them in my code?
    I'm using lwjgl 2.8.5.

     
    Last edit: Sarge 2012-12-07
  • void256
    void256
    2012-12-07

    Nifty does not YET support OpenGL Core Profile when using the native Nifty LWJGL-Renderer. There is not much you can do to work around this, I'm afraid.

    We're already working on it but it might still take a while to get this renderer production ready since we'd like to improve render speed A LOT when switching to Core Profile.

     
  • void256
    void256
    2012-12-08

    You might want to keep an eye on this branch https://github.com/void256/nifty-gui/tree/1.4-lwjgl-core-experiment

    There is still a lot to do but there was some progress and so far it seems to be quite a LOT faster than the original naive approach. I'll need to blog about all of this some time :)

     
    Last edit: void256 2012-12-08
  • Sarge
    Sarge
    2012-12-10

    Wow, cool. I'll keep an eye on it.
    (Theoretically, as far as i can understand, using custom shaders might help a lot to get rid of unneeded calculations on GPU)

     
  • void256
    void256
    2013-03-21

    I've just added Core Profile support to the 1.3 branch of Nifty. See this commit here for details: https://github.com/void256/nifty-gui/commit/0cb9a6fc726c05c1e89f8d965cffc38fc0ea0eff

    The second part of this blog post on the Nifty Blog: http://nifty-gui.lessvoid.com/archives/505 will go into more details.

    If you want to try it, you'll need a nightly build of Nifty 1.3.3 (should be in the Maven repository at sf.net tommorow) and then you can do something like:

    BatchRenderDevice renderDevice = new BatchRenderDevice(
      new LwjglBatchRenderBackendCoreProfile(), 2048, 2048);
    
    nifty = new Nifty(renderDevice, ...
    

    The blog post (part 2) will explain that in more detail.

    As always when using Nifty with native LWJGL you'll need to initialize OpenGL Core Profile before you call any of Niftys methods.