Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on:
workflow_dispatch: # Allow manual triggers
push:
branches: [ "master", "freecad-master" ]
pull_request:
branches: [ "master", "freecad-master" ]
pull_request: {}
schedule:
- cron: '21 10 * * 4'

Expand Down
85 changes: 63 additions & 22 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Continuous Integration Build

on:
workflow_dispatch: # Allow manual triggers
pull_request:
branches: [ master, freecad-master ]
pull_request: {}
#push:
# branches: [ master ]

Expand All @@ -20,7 +19,7 @@ jobs:
uses: docker://rhysd/actionlint:1.7.12

ubuntu-build:
name: Ubuntu Build
name: Ubuntu CI (Legacy renderer enabled)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -30,25 +29,68 @@ jobs:
- name: Create build directory and run CMake
run: |
sudo apt-get -y update
sudo apt-get -y install freeglut3-dev
cmake -S . -B cmake_build_dir -G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=cmake_install_dir \
-DCOIN_STRICT_WARNINGS=ON
sudo apt-get -y install freeglut3-dev libglfw3-dev
cmake -S . -B cmake_build_dir -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake_install_dir -DCOIN_BUILD_LEGACY_GL_RENDERER=ON -DCOIN_BUILD_TESTS=ON -DCOIN_STRICT_WARNINGS=ON
- name: Build project
run: cmake --build cmake_build_dir --target install --config Release -- -j4
run: cmake --build cmake_build_dir --target install --config Release --parallel
- name: Check installed package
run: |
cmake -S testsuite/installed-package-smoke -B installed-package-smoke \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/cmake_install_dir"
cmake --build installed-package-smoke --config Release --parallel
- name: Run tests
run: ctest -C Release -VV
run: ctest -C Release -VV
working-directory: cmake_build_dir
- name: Create Artifacts
uses: actions/upload-artifact@v7
with:
name: Ubuntu-Artifacts
name: Ubuntu-Artifacts-LegacyGL-ON
path: cmake_install_dir/
if: always()

ubuntu-core:
name: Ubuntu core-header smoke
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Create build directory and run CMake
run: |
sudo apt-get -y update
sudo apt-get -y install freeglut3-dev libglfw3-dev
cmake -S . -B cmake_build_dir -G Ninja -DCMAKE_BUILD_TYPE=Release -DCOIN_BUILD_LEGACY_GL_RENDERER=OFF -DCOIN_BUILD_TESTS=OFF -DCOIN_BUILD_EXAMPLES=OFF -DCOIN_BUILD_DOCUMENTATION=OFF
- name: Build core GL glue
run: cmake --build cmake_build_dir --target glue --config Release --parallel

ubuntu-core-profile-runtime:
name: Ubuntu CI (core-profile runtime)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Create build directory and run CMake
run: |
sudo apt-get -y update
sudo apt-get -y install freeglut3-dev libglfw3-dev
cmake -S . -B cmake_build_dir -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCOIN_BUILD_LEGACY_GL_RENDERER=ON -DCOIN_BUILD_TESTS=ON -DCOIN_BUILD_EXAMPLES=OFF -DCOIN_BUILD_DOCUMENTATION=OFF
- name: Build EGL binding test
run: cmake --build cmake_build_dir --target EGLBindingTest GLSLRuntimeTest --config Release -- -j4
- name: Run core-profile OpenGL tests
run: ctest -C Release -R '^(EGLBindingTest|GLSLRuntimeTest)$' --output-on-failure
working-directory: cmake_build_dir
env:
COIN_EGL: 1
EGL_PLATFORM: surfaceless
COIN_EGL_CORE_PROFILE: 1

windows-build:
name: Windows Build
name: Windows CI (Legacy renderer enabled)
runs-on: windows-2022
steps:
- name: Checkout repository
Expand All @@ -58,21 +100,21 @@ jobs:
- name: Create build directory and run CMake
shell: cmd
run: |
cmake -S . -B cmake_build_dir -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake_install_dir
cmake -S . -B cmake_build_dir -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake_install_dir -DCOIN_BUILD_LEGACY_GL_RENDERER=ON -DCOIN_BUILD_TESTS=ON
- name: Build project
run: cmake --build cmake_build_dir --target INSTALL --config Release -- /nologo /verbosity:minimal /maxcpucount:2 /property:MultiProcessorCompilation=true
run: cmake --build cmake_build_dir --target INSTALL --config Release --parallel 2
- name: Run tests
run: ctest -C Release -VV
run: ctest -C Release -VV
working-directory: cmake_build_dir
- name: Create Artifacts
uses: actions/upload-artifact@v7
with:
name: Windows-Artifacts
name: Windows-Artifacts-LegacyGL-ON
path: cmake_install_dir/
if: always()

macos-build:
name: MacOS Build
name: macOS CI (Legacy renderer enabled)
runs-on: macos-14
steps:
- name: Checkout repository
Expand All @@ -81,16 +123,15 @@ jobs:
submodules: recursive
- name: Create build directory and run CMake
run: |
cmake -S . -B cmake_build_dir -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake_install_dir -DCMAKE_CXX_STANDARD=11 -DCOIN_STRICT_WARNINGS=ON
cmake -S . -B cmake_build_dir -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake_install_dir -DCMAKE_CXX_STANDARD=11 -DCOIN_BUILD_LEGACY_GL_RENDERER=ON -DCOIN_BUILD_TESTS=ON
- name: Build project
run: cmake --build cmake_build_dir --target install --config Release -- -j4
run: cmake --build cmake_build_dir --target install --config Release --parallel
- name: Run tests
run: ctest -C Release -VV
run: ctest -C Release -VV
working-directory: cmake_build_dir
- name: Create Artifacts
uses: actions/upload-artifact@v7
with:
name: MacOS-Artifacts
name: macOS-Artifacts-LegacyGL-ON
path: cmake_install_dir/
if: always()

57 changes: 11 additions & 46 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ if(COIN_STRICT_WARNINGS)
endif()
endif()

option(COIN_BUILD_LEGACY_GL_RENDERER
"Build Coin's legacy fixed-function OpenGL renderer."
ON)
set(COIN_HAVE_LEGACY_GL_RENDERER ${COIN_BUILD_LEGACY_GL_RENDERER})

check_include_file_cxx(thread HAVE_STD_THREAD)
cmake_dependent_option(COIN_DEBUG_CHECK_THREAD "Enable thread check in several central Coin functions." OFF "HAVE_STD_THREAD" OFF)

Expand Down Expand Up @@ -675,7 +680,11 @@ check_include_file(ieeefp.h HAVE_IEEEFP_H)
check_include_file(time.h HAVE_TIME_H)
check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)

check_include_file(windows.h HAVE_WINDOWS_H)
if(WIN32)
check_include_file(windows.h HAVE_WINDOWS_H)
else()
set(HAVE_WINDOWS_H 0)
endif()
if(HAVE_WINDOWS_H)
check_include_file(direct.h HAVE_DIRECT_H)
check_include_files("windows.h;tlhelp32.h" HAVE_TLHELP32_H)
Expand Down Expand Up @@ -759,52 +768,8 @@ if(UNIX AND NOT APPLE AND COIN_BUILD_GLX)
" HAVE_GLX)
endif()

# Checks specific OpenGL configurations
if(HAVE_WINDOWS_H)
check_include_files("windows.h;GL/gl.h" HAVE_GL_GL_H)
check_include_files("windows.h;GL/glu.h" HAVE_GL_GLU_H)
check_include_files("windows.h;GL/gl.h;GL/glext.h" HAVE_GL_GLEXT_H)
elseif(APPLE AND NOT COIN_BUILD_MAC_X11)
check_include_file(OpenGL/gl.h HAVE_OPENGL_GL_H)
check_include_file(OpenGL/glu.h HAVE_OPENGL_GLU_H)
check_include_file(OpenGL/glext.h HAVE_OPENGL_GLEXT_H)
if(APPLE AND NOT COIN_BUILD_MAC_X11)
check_include_file(OpenGL/CGLCurrent.h HAVE_OPENGL_CGLCURRENT_H)
else()
check_include_files("GL/gl.h" HAVE_GL_GL_H)
check_include_files("GL/glu.h" HAVE_GL_GLU_H)
check_include_files("GL/gl.h;GL/glext.h" HAVE_GL_GLEXT_H)
endif()

set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES)

if(HAVE_WINDOWS_H)
set(SIM_INCLUDE_WINDOWS_H "#include <windows.h>")
else()
set(SIM_INCLUDE_WINDOWS_H "/* #include <windows.h> - not needed on system */")
endif()
if(HAVE_GL_GL_H)
set(SIM_INCLUDE_GL_H "#include <GL/gl.h>")
elseif(HAVE_OPENGL_GL_H)
set(SIM_INCLUDE_GL_H "#include <OpenGL/gl.h>")
else()
set(SIM_INCLUDE_GL_H "#error \"don't know how to include gl.h header\"")
endif()
if(HAVE_SUPERGLU)
set(SIM_INCLUDE_GLU_H "/* #include <GL/glu.h> - not used, Coin linked with embedded SuperGLU */")
elseif(HAVE_GL_GLU_H)
set(SIM_INCLUDE_GLU_H "#include <GL/glu.h>")
elseif(HAVE_OPENGL_GLU_H)
set(SIM_INCLUDE_GLU_H "#include <OpenGL/glu.h>")
else()
set(SIM_INCLUDE_GLU_H "/* #include <GL/glu.h> - not found on system */")
endif()
if(HAVE_GL_GLEXT_H)
set(SIM_INCLUDE_GLEXT_H "#include <GL/glext.h>")
elseif(HAVE_OPENGL_GLEXT_H)
set(SIM_INCLUDE_GLEXT_H "#include <OpenGL/glext.h>")
else()
set(SIM_INCLUDE_GLEXT_H "/* #include <GL/glext.h> - not found on system */")
endif()

check_symbol_exists(va_copy stdarg.h HAVE_VA_COPY_MACRO)
Expand Down
24 changes: 16 additions & 8 deletions include/Inventor/C/basic.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
#ifndef COIN_BASIC_H
#define COIN_BASIC_H

/* Whether this Coin library contains the LegacyGL renderer. */
#cmakedefine01 COIN_HAVE_LEGACY_GL_RENDERER

/*
NOTE: basic.h is automatically generated from basic.h.in, so don't
edit basic.h directly.
Expand Down Expand Up @@ -242,8 +245,13 @@ typedef uint32_t SbUniqueId;

/* *********************************************************************** */

/* Private implementation visibility is independent from the library's ABI role. */
#if defined(COIN_BUILDING_COIN) && !defined(COIN_INTERNAL)
# error COIN_BUILDING_COIN requires COIN_INTERNAL.
#endif

/* For Visual Studio compiler use COIN_DLL by default and auto-linking. */
#if !defined(COIN_INTERNAL) && defined(_MSC_VER)
#if !defined(COIN_BUILDING_COIN) && defined(_MSC_VER)
# if !defined(COIN_NOT_DLL) && !defined(COIN_DLL)
# define COIN_DLL
# endif
Expand All @@ -270,14 +278,14 @@ typedef uint32_t SbUniqueId;
#ifdef COIN_DLL_API
# error Leave the internal COIN_DLL_API define alone.
#endif /* COIN_DLL_API */
#ifdef COIN_INTERNAL
#ifdef COIN_BUILDING_COIN
# ifdef COIN_NOT_DLL
# error The COIN_NOT_DLL define is not supposed to be used when building the library, only when building Win32 applications.
# endif /* COIN_INTERNAL && COIN_NOT_DLL */
# endif /* COIN_BUILDING_COIN && COIN_NOT_DLL */
# ifdef COIN_DLL
# error The COIN_DLL define is not supposed to be used when building the library, only when building Win32 applications.
# endif /* COIN_INTERNAL && COIN_DLL */
#endif /* COIN_INTERNAL */
# endif /* COIN_BUILDING_COIN && COIN_DLL */
#endif /* COIN_BUILDING_COIN */

/*
On MSWindows platforms, one of these defines must always be set when
Expand Down Expand Up @@ -311,11 +319,11 @@ typedef uint32_t SbUniqueId;
recognize the __declspec keyword instead of the crap #if below.
20011201 mortene. */
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
# ifdef COIN_INTERNAL
# ifdef COIN_BUILDING_COIN
# ifdef COIN_MAKE_DLL
# define COIN_DLL_API __declspec(dllexport)
# endif /* COIN_MAKE_DLL */
# else /* !COIN_INTERNAL */
# else /* !COIN_BUILDING_COIN */
# ifdef COIN_DLL
# ifdef COIN_NOT_DLL
# error Define _either_ COIN_DLL _or_ COIN_NOT_DLL as appropriate for your linkage -- not both at the same time! See Inventor/C/basic.h for further instructions.
Expand All @@ -326,7 +334,7 @@ typedef uint32_t SbUniqueId;
# error Define either COIN_DLL or COIN_NOT_DLL as appropriate for your linkage! See Inventor/C/basic.h for further instructions.
# endif /* !COIN_NOT_DLL */
# endif /* !COIN_DLL */
# endif /* !COIN_INTERNAL */
# endif /* !COIN_BUILDING_COIN */
#endif /* Microsoft Windows */

/* Empty define to avoid errors when _not_ compiling an MSWindows DLL. */
Expand Down
2 changes: 2 additions & 0 deletions include/Inventor/C/glue/gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ COIN_DLL_API void * cc_glglue_getprocaddress(const cc_glglue * glue, const char
through any software indirection layer over GLX). */
COIN_DLL_API SbBool cc_glglue_isdirect(const cc_glglue * w);

/* Returns TRUE if the current OpenGL context supports legacy rendering. */
COIN_DLL_API SbBool cc_glglue_context_supports_legacy_rendering(const cc_glglue * glue);

/*** Wrapped OpenGL 1.1+ features and extensions. *********************/

Expand Down
Loading
Loading