https://linen.dev logo
Join Discord
Powered by
# lime
  • t

    tall-teacher-57409

    05/25/2023, 2:45 PM
    yep
  • t

    tall-teacher-57409

    05/25/2023, 2:46 PM
    not sure on how to debug even
  • h

    hallowed-ocean-84954

    05/25/2023, 2:46 PM
    Debugger would be good but if not then trace before that line. Openglutils.hx is your code right ?
  • t

    tall-teacher-57409

    05/25/2023, 2:47 PM
    yeah
  • h

    hallowed-ocean-84954

    05/25/2023, 2:47 PM
    Ok. So you know the offending line. Check everything related to the constant that could be null
  • t

    tall-teacher-57409

    05/25/2023, 2:50 PM
    hmm
  • t

    tall-teacher-57409

    05/25/2023, 2:50 PM
    lets see
  • t

    tall-teacher-57409

    05/25/2023, 2:50 PM
    nothing looks wrong here 😞

    https://cdn.discordapp.com/attachments/769686258049351722/1111305400994770954/image.png▾

  • t

    tall-teacher-57409

    05/25/2023, 2:51 PM
    that's line 40
  • t

    tall-teacher-57409

    05/25/2023, 2:51 PM
    (
    var vs = glCreateShader....
    )
  • p

    powerful-morning-89

    05/25/2023, 2:52 PM
    Well, the error implies that
    gl
    is null. How are you obtaining the GL context?
  • t

    tall-teacher-57409

    05/25/2023, 2:52 PM

    https://cdn.discordapp.com/attachments/769686258049351722/1111305826796314764/image.png▾

  • t

    tall-teacher-57409

    05/25/2023, 2:52 PM
    works fine with html5 though
  • p

    powerful-morning-89

    05/25/2023, 2:53 PM
    Try using
    WebGLRenderContext
    (and
    context.webgl
    ) instead...
  • t

    tall-teacher-57409

    05/25/2023, 2:55 PM

    https://cdn.discordapp.com/attachments/769686258049351722/1111306668576354424/image.png▾

  • p

    powerful-morning-89

    05/25/2023, 2:56 PM
    Ctrl + Shift + F
    replace
    WebGL2RenderContext
    with
    WebGLRenderContext
    everywhere
  • t

    tall-teacher-57409

    05/25/2023, 2:58 PM
    yay works now
  • t

    tall-teacher-57409

    05/25/2023, 2:58 PM
    thanks Zeta! ❤️
  • p

    powerful-morning-89

    05/25/2023, 3:03 PM
    Ahah, this explains it: You'll only get a WebGL2 context on native if you're running on something with OpenGL ES 3.0+. And on Linux desktop you'll get a "desktop" OpenGL context.
  • t

    tall-teacher-57409

    05/25/2023, 3:10 PM
    oh that makes sense
  • h

    hallowed-ocean-84954

    05/25/2023, 3:15 PM
    Interesting cos webgl2 works on windows. There will be one or two places where this will make a difference to something de Vries does. Iirc I switched from webgl to webgl2 for something specific. But you can always #if around it
  • p

    powerful-morning-89

    05/25/2023, 3:16 PM
    > webgl2 works on windows. ...I'd have expected the opposite, given that on Linux you can get an actual OpenGL ES context but not on Windows.
  • h

    hallowed-ocean-84954

    05/25/2023, 3:17 PM
    I use the webgl2rendercontext on Windows, hl and html5 and it seems to be fine
  • h

    hallowed-ocean-84954

    05/25/2023, 3:18 PM
    But I think I do it via a cast somewhere. Would have to check. I changed that code more than once
  • p

    powerful-morning-89

    05/25/2023, 3:19 PM
    In the native code
    LIME_GLES3_API
    is only defined on Linux, iOS and Tizen, so I'd expect that the WebGL2RenderContext would only be available there (+html5 of course)
  • p

    powerful-morning-89

    05/25/2023, 3:23 PM
    (Well there's still a runtime version check )
  • h

    hallowed-ocean-84954

    05/25/2023, 3:30 PM
    ok interesting - in Main I use the OpenGLRenderer once in a piece of code I simply don't remember the purpose for - I call setShader(null) on it. Thereafter everywhere else I use WebGL2RenderContext which I get this way in my openfl addedToStage() event handler:
    Copy code
    _gl = cast(stage.window.context.webgl, WebGL2RenderContext);
  • h

    hallowed-ocean-84954

    05/25/2023, 3:30 PM
    it's perhaps an Openfl thing that even makes this possible
  • p

    powerful-morning-89

    05/25/2023, 3:31 PM
    WebGL2RenderContext is an abstract over probably another abstract. So that cast is not actually checked, since all the contexts end up being the same type at runtime.
  • h

    hallowed-ocean-84954

    05/25/2023, 3:32 PM
    I knew it was an abstract but it does have additional constants that I could not access from WebGLRenderContext - not many that I needed but definitely some
1...134135136137138Latest