- Version check: revert to majorVersion() < 4 instead of checking for
specifically 4.3. On macOS, init_ogl_context() caps to 4.1 core
profile; compat shaders (attribute/varying) would fail in core
contexts. The #version 150 modern shaders work fine on any 4.x.
This also correctly handles future OpenGL 5+.
- Warning: use static guard so the message emits only once, even if
compile_shaders() is called multiple times.
Fix compatibility shaders and OpenGL version detection that caused
CGAL::draw() to render solid black geometry on systems with OpenGL < 4.3.
Basic_shaders.h:
- VERTEX_SOURCE_COLOR_COMP: change 'varying' to 'attribute' for vertex
inputs (a_Pos, a_Normal, a_Color) as required by GLSL 1.10/1.20
- VERTEX_SOURCE_COLOR_COMP: replace undefined 'mv_matrix' reference with
'mat3(u_Mv) * a_Normal' matching the declared uniform
- VERTEX_SOURCE_P_L_COMP: change 'varying' to 'attribute' for vertex
inputs (a_Pos, a_Color)
qglviewer_impl.h:
- Initialize is_ogl_4_3 to false in defaultConstructor() to avoid UB
- Fix version check: use major < 4 || (major == 4 && minor < 3) instead
of major != 4, so OpenGL 4.0-4.2 correctly falls back and 5+ works
Basic_viewer.h:
- Add std::cerr warning when compatibility shaders are selected
That will suppress the warnings about `CMP0167` (from CMake 3.30):
```
CMake Warning (dev) at cmake/modules/display-third-party-libs-versions.cmake:37 (find_package):
Policy CMP0167 is not set: The FindBoost module is removed. Run "cmake
--help-policy CMP0167" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
```
## Summary of Changes
- Changed `PUBLIC` to `PRIVATE` in the `target_link_libraries()`
- ~~Link against `Boost::<COMPONENT>`~~ as we do more than just linking
and must use the `CGAL::_.._support`
- Use `target_compile_definitions()` and `add_compile_definitions()`
More to be done.
## Release Management
* Affected package(s): all
* Issue(s) solved (if any): fix one item of #4815
* License and copyright ownership: unchanged