On Thursday, 29 September 2022 at 08:56:28 UTC+1 Manolo wrote:
With the last commit (da66e21), the addition of FLTK widgets to an OpenGL 3-based Fl_Gl_Window
works in my hands accross all platforms and OS versions, including Windows 10-32-bit and macOS 10.9.
Toggle betwen double and single buffer modes also works.
OK - this commit seems to work - mostly. My macOS and 64-bit Win builds are now good.
32-bit Win still crashes for me.
I assumed that was some weirdness in my messed-up mingw configuration (it often is!) but possibly not this time.
Since I now (coincidentally) have a working 32-bit MSVC build, I fired that off and it also fails in the same way.
Since I'm running to from the IDE, MSVC reports this is because:
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
This is in the method (the debugger flags that exception at the end of this method):
void Fl_Gl_Window_Driver::switch_to_GL1() {
if (!glUseProgram_f) {
glUseProgram_f = (glUseProgram_type)GetProcAddress("glUseProgram");
}
glGetIntegerv(GL_CURRENT_PROGRAM, ¤t_prog);
// Switch from GL3-style to GL1-style drawing;
// good under Windows, X11 and Wayland; not appropriate under macOS.
// suggested by https://stackoverflow.com/questions/22293870/mixing-fixed-function-pipeline-and-programmable-pipeline-in-opengl
if (current_prog) glUseProgram_f(0);
}
The GLEW lib I'm using for this test was built with the same MSVC IDE, so I assume it is compatible here.
TBH I have no solid idea what that error message is actually telling us happened here!
Clearly, whatever it is, it works fine on other platforms...