Re: [fltk.coredev] GL root Fl_Gl_Window::draw

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
Previous Message ]New Message | Reply ]Next Message ]

Re: GL root Fl_Gl_Window::draw imm 06:17 Sep 30 top right image
On Fri, 30 Sept 2022 at 12:56, imacarthur <> wrote:
> Staring at this a bit, I assume the issue is that (under 32-bit Windows) we're invoking the function pointer  glUseProgram_f() with the wrong calling convention (given that Windows seems to have several calling conventions.)
> But... I'm not sure that we are, it kinda looks OK.
> Don't know.

Seems to be a calling convention thing after all.
Explicitly changing the typedef for glUseProgram_type in
Fl_Gl_Window_Driver.H to become either of:

     typedef void(__stdcall *glUseProgram_type)(GLint);


     typedef void(APIENTRY *glUseProgram_type)(GLint);

Works for me, and the 32-bit mingw and (32-bit) MSVC builds no longer
segfault, indeed they now work correctly.
I think (but am not sure!) that the second form (the APIENTRY format)
is the more "portable" option.

But in either case we'll need something clever around that typedef as
setting APIENTRY is *not* going to be correct on macOS or X11!

You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Direct Link to Message ]
bottom left image   bottom right image
Previous Message ]New Message | Reply ]Next Message ]

Comments are owned by the poster. All other content is copyright 1998-2023 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to ''.