GLFW and FLTK (feature request)

70 views
Skip to first unread message

Gonzalo Garramuño

unread,
Aug 26, 2023, 1:52:42 PM8/26/23
to fltkg...@googlegroups.com
I am currently using FLTK 1.4 together with a library that uses GLFW
briefly in a new thread.  The GLFW code seems correct and works in both
a GLFW application as in a Qt6 one.

However, I am seeing in FLTK's OpenGL window's draw() that is getting
called with a 0 OpenGL context in any OS, albeit FLTK's Fl_Gl_Window's
context is valid and not 0. This seems to happen briefly in one
invocation and FLTK will call the draw() function again with a proper
context.  I tried calling make_current() from the draw() function to no
avail, as it seems optimized to check the context() value.

I check the OS context with:

    void* GLContextDebug::get()
    {
#ifdef _WIN32
        return (void*)wglGetCurrentContext();
#endif
#ifdef FLTK_USE_X11
        if (fl_x11_display())
            return (void*)glXGetCurrentContext();
#endif
#ifdef FLTK_USE_WAYLAND
        if (fl_wl_display())
            return (void*)eglGetCurrentContext();
#endif
#ifdef __APPLE__
        return (void*)aglGetCurrentContext();
#endif
        throw std::runtime_error("No Window API known");
    }

Any ideas what I can try?

As a feature request, one of the nice features of GLFW that FLTK is
missing is that it allows adding OpenGL Context debugging, with:

glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GLFW_TRUE);

when the window is created.

--
Gonzalo Garramuño
ggar...@gmail.com

Reply all
Reply to author
Forward
0 new messages