Skip to content

Commit

Permalink
Merge pull request #531 from benj5378/eglDustOff2
Browse files Browse the repository at this point in the history
Egl dust off2
  • Loading branch information
VolkerEnderlein authored Jan 15, 2025
2 parents 3e32cfe + 9e7d403 commit 67a4b06
Show file tree
Hide file tree
Showing 23 changed files with 713 additions and 24 deletions.
30 changes: 24 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ cmake_dependent_option(COIN_BUILD_MAC_FRAMEWORK "Build framework instead of dyli
cmake_dependent_option(COIN_BUILD_MAC_X11 "Build for X11 on Mac OS X when ON. Default is OFF." OFF "APPLE" OFF)
cmake_dependent_option(COIN_BUILD_MAC_AGL "Build for AGL on Mac OS X when ON. Default is OFF." OFF "APPLE" OFF)

option(COIN_BUILD_EGL "Build for EGL on Linux when ON. Default is OFF." OFF)

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 All @@ -120,6 +122,7 @@ report_prepare(
COIN_BUILD_DOCUMENTATION_MAN
COIN_BUILD_DOCUMENTATION_QTHELP
COIN_BUILD_DOCUMENTATION_CHM
COIN_BUILD_EGL
COIN_BUILD_AWESOME_DOCUMENTATION
COIN_THREADSAFE
HAVE_VRML97
Expand Down Expand Up @@ -207,7 +210,7 @@ if(COIN_BUILD_MAC_X11)
list(APPEND COIN_TARGET_LINK_LIBRARIES ${X11_LIBRARIES} ${X11_GL_LIB} ${X11_GLU_LIB})
endif()
else()
if(UNIX AND NOT APPLE)
if(UNIX AND NOT APPLE AND NOT COIN_BUILD_EGL)
find_package(X11 REQUIRED)
list(APPEND COIN_TARGET_INCLUDE_DIRECTORIES ${X11_INCLUDE_DIR})
list(APPEND COIN_TARGET_LINK_LIBRARIES ${X11_LIBRARIES})
Expand All @@ -216,18 +219,33 @@ else()
if(OPENGL_FOUND)
set(HAVE_OPENGL 1)
set(OPENGL_SYSTEM_LIBRARY_NAME "${OPENGL_gl_LIBRARY}${CMAKE_SHARED_LIBRARY_SUFFIX}")
if(OpenGL_GLU_FOUND)
set(HAVE_GLU 1)
if(COIN_BUILD_EGL AND OpenGL_EGL_FOUND)
set(HAVE_EGL 1)
if (NOT TARGET OpenGL::EGL)
list(APPEND COIN_TARGET_INCLUDE_DIRECTORIES ${OPENGL_EGL_INCLUDE_DIR})
list(APPEND COIN_TARGET_LINK_LIBRARIES ${OPENGL_egl_LIBRARY})
else()
list(APPEND COIN_TARGET_LINK_LIBRARIES OpenGL::EGL)
endif()
endif()
if(APPLE)
set(GLU_IS_PART_OF_GL 1)
endif()
#include_directories("${OPENGL_INCLUDE_DIR}")
if (NOT TARGET OpenGL::GL)
list(APPEND COIN_TARGET_INCLUDE_DIRECTORIES ${OPENGL_INCLUDE_DIR})
list(APPEND COIN_TARGET_LINK_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
list(APPEND COIN_TARGET_LINK_LIBRARIES ${OPENGL_gl_LIBRARY})
else()
list(APPEND COIN_TARGET_LINK_LIBRARIES OpenGL::GL OpenGL::GLU)
list(APPEND COIN_TARGET_LINK_LIBRARIES OpenGL::GL)
endif()
if(OpenGL_GLU_FOUND AND NOT COIN_BUILD_EGL)
set(HAVE_GLU 1)
if (NOT TARGET OpenGL::GLU)
list(APPEND COIN_TARGET_INCLUDE_DIRECTORIES ${OPENGL_INCLUDE_DIR})
list(APPEND COIN_TARGET_LINK_LIBRARIES ${OPENGL_glu_LIBRARY})
else()
list(APPEND COIN_TARGET_LINK_LIBRARIES OpenGL::GLU)
endif()
endif()
endif()
endif()
Expand Down Expand Up @@ -679,7 +697,7 @@ elseif(APPLE)
endif()
endif()

if(NOT (HAVE_WGL OR HAVE_AGL OR HAVE_CGL OR HAVE_GLX))
if(NOT (HAVE_WGL OR HAVE_AGL OR HAVE_CGL OR HAVE_GLX OR HAVE_EGL))
if (NOT TARGET OpenGL::GLX)
if (OPENGL_glx_LIBRARY)
list(APPEND COIN_TARGET_LINK_LIBRARIES ${OPENGL_glx_LIBRARY})
Expand Down
28 changes: 28 additions & 0 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -11494,6 +11494,34 @@ else
fi
]) # SIM_AC_HAVE_CGL_IFELSE()

# **************************************************************************
# SIM_AC_HAVE_EGL_IFELSE( IF-FOUND, IF-NOT-FOUND )
#
# Check whether EGL is on the system.

AC_DEFUN([SIM_AC_HAVE_EGL_IFELSE], [
sim_ac_save_libs=$LIBS
sim_ac_egl_libs="-lEGL"
LIBS="$LIBS $sim_ac_egl_libs"
AC_CACHE_CHECK(
[whether EGL is on the system],
sim_cv_have_egl,
AC_TRY_LINK(
[#include <EGL/egl.h>
#include <EGL/eglext.h>],
[eglGetError();],
[sim_cv_have_egl=true],
[sim_cv_have_egl=false]))
LIBS="$LIBS $sim_ac_egl_libs"
if ${sim_cv_have_egl=false}; then
ifelse([$1], , :, [$1])
else
ifelse([$2], , :, [$2])
fi
]) # SIM_AC_HAVE_EGL_IFELSE()

# Usage:
# SIM_AC_PACKAGEMAKER_APP([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
#
Expand Down
3 changes: 3 additions & 0 deletions build/msvc10/src/config-debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* define if you have CGL OpenGL bindings */
/* #undef HAVE_CGL */

/* define if you have EGL bindings */
/* #undef HAVE_EGL */

/* The CPP compiler has a variable containing the current function name */
#define HAVE_CPP_COMPILER_FUNCTION_NAME_VAR __FUNCTION__

Expand Down
3 changes: 3 additions & 0 deletions build/msvc10/src/config-release.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* define if you have CGL OpenGL bindings */
/* #undef HAVE_CGL */

/* define if you have EGL bindings */
/* #undef HAVE_EGL */

/* The CPP compiler has a variable containing the current function name */
#define HAVE_CPP_COMPILER_FUNCTION_NAME_VAR __FUNCTION__

Expand Down
3 changes: 3 additions & 0 deletions build/msvc6/src/config-debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* define if you have CGL OpenGL bindings */
/* #undef HAVE_CGL */

/* define if you have EGL bindings */
/* #undef HAVE_EGL */

/* The CPP compiler has a variable containing the current function name */
/* #undef HAVE_CPP_COMPILER_FUNCTION_NAME_VAR */

Expand Down
3 changes: 3 additions & 0 deletions build/msvc6/src/config-release.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* define if you have CGL OpenGL bindings */
/* #undef HAVE_CGL */

/* define if you have EGL bindings */
/* #undef HAVE_EGL */

/* The CPP compiler has a variable containing the current function name */
/* #undef HAVE_CPP_COMPILER_FUNCTION_NAME_VAR */

Expand Down
3 changes: 3 additions & 0 deletions build/msvc7/src/config-debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* define if you have CGL OpenGL bindings */
/* #undef HAVE_CGL */

/* define if you have EGL bindings */
/* #undef HAVE_EGL */

/* The CPP compiler has a variable containing the current function name */
#define HAVE_CPP_COMPILER_FUNCTION_NAME_VAR __FUNCTION__

Expand Down
3 changes: 3 additions & 0 deletions build/msvc7/src/config-release.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* define if you have CGL OpenGL bindings */
/* #undef HAVE_CGL */

/* define if you have EGL bindings */
/* #undef HAVE_EGL */

/* The CPP compiler has a variable containing the current function name */
#define HAVE_CPP_COMPILER_FUNCTION_NAME_VAR __FUNCTION__

Expand Down
3 changes: 3 additions & 0 deletions build/msvc8/src/config-debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* define if you have CGL OpenGL bindings */
/* #undef HAVE_CGL */

/* define if you have EGL bindings */
/* #undef HAVE_EGL */

/* The CPP compiler has a variable containing the current function name */
#define HAVE_CPP_COMPILER_FUNCTION_NAME_VAR __FUNCTION__

Expand Down
3 changes: 3 additions & 0 deletions build/msvc8/src/config-release.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* define if you have CGL OpenGL bindings */
/* #undef HAVE_CGL */

/* define if you have EGL bindings */
/* #undef HAVE_EGL */

/* The CPP compiler has a variable containing the current function name */
#define HAVE_CPP_COMPILER_FUNCTION_NAME_VAR __FUNCTION__

Expand Down
3 changes: 3 additions & 0 deletions build/msvc9/src/config-debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* define if you have CGL OpenGL bindings */
/* #undef HAVE_CGL */

/* define if you have EGL bindings */
/* #undef HAVE_EGL */

/* The CPP compiler has a variable containing the current function name */
#define HAVE_CPP_COMPILER_FUNCTION_NAME_VAR __FUNCTION__

Expand Down
3 changes: 3 additions & 0 deletions build/msvc9/src/config-release.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
/* define if you have CGL OpenGL bindings */
/* #undef HAVE_CGL */

/* define if you have EGL bindings */
/* #undef HAVE_EGL */

/* The CPP compiler has a variable containing the current function name */
#define HAVE_CPP_COMPILER_FUNCTION_NAME_VAR __FUNCTION__

Expand Down
3 changes: 3 additions & 0 deletions src/config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
/* define if you have CGL OpenGL bindings */
#cmakedefine HAVE_CGL

/* define if you have EGL OpenGL bindings */
#cmakedefine HAVE_EGL

/* define if you have the CoreText framework */
#cmakedefine HAVE_CORETEXT

Expand Down
3 changes: 3 additions & 0 deletions src/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
/* define if you have CGL OpenGL bindings */
#undef HAVE_CGL

/* define if you have EGL OpenGL bindings */
#undef HAVE_EGL

/* define if you have the CoreText framework */
#undef HAVE_CORETEXT

Expand Down
3 changes: 3 additions & 0 deletions src/discard.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@
/* define if vsnprintf() is available */
#undef HAVE_VSNPRINTF

/* define if you have EGL OpenGL bindings */
#undef HAVE_EGL

/* define if you have WGL Win32 OpenGL bindings */
#undef HAVE_WGL

Expand Down
3 changes: 3 additions & 0 deletions src/glue/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set(COIN_GLUE_FILES
gl_wgl.cpp
gl_agl.cpp
gl_cgl.cpp
gl_egl.cpp
gl_glx.cpp
GLUWrapper.cpp
simage_wrapper.cpp
Expand All @@ -29,6 +30,8 @@ set(COIN_GLUE_INTERNAL_FILES
gl_agl.cpp
gl_cgl.h
gl_cgl.cpp
gl_egl.h
gl_egl.cpp
gl_glx.h
gl_glx.cpp
GLUWrapper.h
Expand Down
3 changes: 2 additions & 1 deletion src/glue/Makefile.am

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 18 additions & 14 deletions src/glue/Makefile.in

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/glue/all-glue-cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "gl_glx.cpp"
#include "gl_agl.cpp"
#include "gl_cgl.cpp"
#include "gl_egl.cpp"

#include "cg.cpp"
#include "spidermonkey.cpp"
Expand Down
Loading

0 comments on commit 67a4b06

Please sign in to comment.