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 <imacarthur@gmail.com> 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);

or

     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 fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/CAGFM6daO8u3eJx8Aagk3et6WNStqrOvhOJb-L0gS4GvDnnqjoA%40mail.gmail.com.
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-2022 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.