0032206: Visualization, TKOpenGl - move out OpenGL ES support to dedicated library...
authorkgv <kgv@opencascade.com>
Wed, 17 Mar 2021 18:03:04 +0000 (21:03 +0300)
committerbugmaster <bugmaster@opencascade.com>
Sun, 21 Mar 2021 16:15:06 +0000 (19:15 +0300)
Added TKOpenGles and TKOpenGlesTest toolkits built with HAVE_GLES2 macros.
Added CSF_OpenGlesLibs as alternative to CSF_OpenGlLibs.

40 files changed:
CMakeLists.txt
adm/MODULES
adm/UDLIST
adm/cmake/egl.cmake
adm/cmake/gles2.cmake
adm/cmake/occt_csf.cmake
adm/cmake/occt_toolkit.cmake
adm/cmake/vardescr.cmake
adm/genproj.tcl
adm/qmake/OccCppConfig.pri
adm/qmake/OccModule.pri
adm/qmake/OccToolkit.pri
adm/templates/env.bat
adm/templates/env.sh
adm/templates/template.vc10
adm/templates/template.vc10x
dox/upgrade/upgrade.md
samples/ios/UIKitSample/UIKitSample.xcodeproj/project.pbxproj
samples/java/jniviewer/app/src/main/java/com/opencascade/jnisample/OcctJniActivity.java
samples/java/jniviewer/app/src/main/jni/CMakeLists.txt
samples/qt/AndroidQt/OCCT.pri
samples/webgl/CMakeLists.txt
samples/webgl/WasmOcctView.cpp
src/Draw/Draw_BasicCommands.cxx
src/DrawResources/DrawPlugin
src/OS/Draw.tcl
src/OS/Visualization.tcl
src/OpenGl/OpenGl_GraphicDriver.cxx
src/OpenGl/OpenGl_GraphicDriver.hxx
src/OpenGl/OpenGl_GraphicDriverFactory.cxx
src/TKOpenGles/CMakeLists.txt [new file with mode: 0644]
src/TKOpenGles/EXTERNLIB [new file with mode: 0644]
src/TKOpenGles/FILES [new file with mode: 0644]
src/TKOpenGles/PACKAGES [new file with mode: 0644]
src/TKOpenGlesTest/CMakeLists.txt [new file with mode: 0644]
src/TKOpenGlesTest/EXTERNLIB [new file with mode: 0644]
src/TKOpenGlesTest/FILES [new file with mode: 0644]
src/TKOpenGlesTest/PACKAGES [new file with mode: 0644]
src/ViewerTest/ViewerTest_ViewerCommands.cxx
tests/v3d/glsl/opengles [new file with mode: 0644]

index 85b8966..d565e39 100644 (file)
@@ -414,6 +414,14 @@ if (NOT DEFINED BUILD_DOC_Overview)
   set (BUILD_DOC_Overview ${CAN_DOXYGEN_BE_USED} CACHE BOOL "${BUILD_DOC_Overview_DESCR}")
 endif()
 
+if (ANDROID OR IOS OR EMSCRIPTEN OR "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
+  list (REMOVE_ITEM Visualization_TOOLKITS TKOpenGl)
+  list (REMOVE_ITEM Draw_TOOLKITS TKOpenGlTest)
+elseif (NOT USE_GLES2)
+  list (REMOVE_ITEM Visualization_TOOLKITS TKOpenGles)
+  list (REMOVE_ITEM Draw_TOOLKITS TKOpenGlesTest)
+endif()
+
 if (NOT USE_D3D)
   list (REMOVE_ITEM Visualization_TOOLKITS TKD3DHost)
   list (REMOVE_ITEM Draw_TOOLKITS TKD3DHostTest)
@@ -486,7 +494,8 @@ endif()
 OCCT_IS_PRODUCT_REQUIRED (CSF_FreeImagePlus CAN_USE_FREEIMAGE)
 OCCT_IS_PRODUCT_REQUIRED (CSF_TclLibs USE_TCL)
 OCCT_IS_PRODUCT_REQUIRED (CSF_FREETYPE USE_FREETYPE)
-OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_GLES2)
+OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_OPENGL)
+OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlesLibs CAN_USE_GLES2)
 OCCT_IS_PRODUCT_REQUIRED (CSF_TBB CAN_USE_TBB)
 OCCT_IS_PRODUCT_REQUIRED (CSF_EIGEN CAN_USE_EIGEN)
 
@@ -607,6 +616,16 @@ else()
   OCCT_CHECK_AND_UNSET ("INSTALL_FFMPEG")
 endif()
 
+# OpenGL
+if (CAN_USE_OPENGL)
+  set (USE_OPENGL ON CACHE BOOL "${USE_OPENGL_DESCR}")
+  if (USE_OPENGL)
+    add_definitions (-DHAVE_OPENGL_EXT)
+  endif()
+else()
+  OCCT_CHECK_AND_UNSET ("USE_OPENGL")
+endif()
+
 # OpenGL ES 2.0
 if (CAN_USE_GLES2)
   if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
@@ -616,9 +635,9 @@ if (CAN_USE_GLES2)
   endif()
 
   if (USE_GLES2)
-    add_definitions (-DHAVE_GLES2)
+    add_definitions (-DHAVE_GLES2_EXT)
     OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
-       OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
+    OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
   else()
     OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL")
     OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2")
@@ -1140,6 +1159,9 @@ foreach (OCCT_TOOLKIT ${BUILD_TOOLKITS})
 endforeach()
 list (REMOVE_DUPLICATES OCCT_MODULES_ENABLED)
 list (REMOVE_DUPLICATES OCCT_COMPILE_DEFINITIONS)
+# these macros are defined for specific tookits, not globalwise
+list (REMOVE_ITEM OCCT_COMPILE_DEFINITIONS HAVE_OPENGL)
+list (REMOVE_ITEM OCCT_COMPILE_DEFINITIONS HAVE_GLES2)
 
 # export compile definitions and C/C++ flags for each configuration to OpenCASCADE config files
 foreach (OCCT_CONFIGURATION ${CMAKE_CONFIGURATION_TYPES})
index 58f65a0..724bf81 100644 (file)
@@ -1,7 +1,7 @@
 FoundationClasses TKernel TKMath
 ModelingData TKG2d TKG3d TKGeomBase TKBRep
 ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
-Visualization TKService TKV3d TKOpenGl TKMeshVS TKIVtk TKD3DHost
+Visualization TKService TKV3d TKOpenGl TKOpenGles TKMeshVS TKIVtk TKD3DHost
 ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
 DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF TKRWMesh
-Draw TKDraw TKTopTest TKOpenGlTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE
+Draw TKDraw TKTopTest TKOpenGlTest TKOpenGlesTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE
index 3bbef06..3f3993a 100644 (file)
@@ -207,6 +207,7 @@ n Image
 n Media
 n MeshVS
 n OpenGl
+n OpenGles
 n D3DHost
 n Prs3d
 n PrsMgr
@@ -224,6 +225,7 @@ r Shaders
 r XRResources
 t TKMeshVS
 t TKOpenGl
+t TKOpenGles
 t TKD3DHost
 t TKService
 t TKV3d
@@ -403,6 +405,7 @@ n MeshTest
 n SWDRAW
 n TObjDRAW
 n OpenGlTest
+n OpenGlesTest
 n D3DHostTest
 n ViewerTest
 n XDEDRAW
@@ -416,6 +419,7 @@ t TKDraw
 t TKTObjDRAW
 t TKTopTest
 t TKOpenGlTest
+t TKOpenGlesTest
 t TKD3DHostTest
 t TKViewerTest
 t TKXDEDRAW
index d6b1c4b..396ff05 100644 (file)
@@ -1,3 +1,3 @@
 # EGL
 
-THIRDPARTY_PRODUCT("EGL" "EGL/egl.h" "CSF_OpenGlLibs" "")
+THIRDPARTY_PRODUCT("EGL" "EGL/egl.h" "CSF_OpenGlesLibs" "")
index adbb787..ecc4f8d 100644 (file)
@@ -1,3 +1,3 @@
 # OpenGL ES 2.0
 
-THIRDPARTY_PRODUCT("GLES2" "GLES2/gl2.h" "CSF_OpenGlLibs" "")
+THIRDPARTY_PRODUCT("GLES2" "GLES2/gl2.h" "CSF_OpenGlesLibs" "")
index 46d22ff..4d71624 100644 (file)
@@ -74,12 +74,8 @@ if (WIN32)
   set (CSF_psapi         "psapi.lib")
   set (CSF_winmm         "winmm.lib")
   set (CSF_d3d9          "D3D9.lib")
-  if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" OR USE_GLES2)
-    set (CSF_OpenGlLibs  "libEGL libGLESv2")
-  else()
-    set (CSF_OpenGlLibs  "opengl32.lib")
-  endif()
-
+  set (CSF_OpenGlLibs    "opengl32.lib")
+  set (CSF_OpenGlesLibs  "libEGL libGLESv2")
 else()
 
   if (APPLE)
@@ -100,9 +96,9 @@ else()
     OCCT_CHECK_AND_UNSET (IOKit_LIB)
 
     if (IOS)
-      find_library (OpenGlLibs_LIB NAMES OpenGLES)
-      set (CSF_OpenGlLibs ${OpenGlLibs_LIB})
-      OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
+      find_library (OpenGlesLibs_LIB NAMES OpenGLES)
+      set (CSF_OpenGlesLibs ${OpenGlesLibs_LIB})
+      OCCT_CHECK_AND_UNSET (OpenGlesLibs_LIB)
     elseif (USE_GLX)
       set (CSF_OpenGlLibs GL)
       set (CSF_XwLibs     "X11 Xext Xmu Xi")
@@ -111,18 +107,15 @@ else()
       set (CSF_OpenGlLibs ${OpenGlLibs_LIB})
       OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
     endif()
-    
+
   elseif (ANDROID)
     set (CSF_ThreadLibs  "c")
-    set (CSF_OpenGlLibs  "EGL GLESv2")
+    set (CSF_OpenGlesLibs "EGL GLESv2")
     set (CSF_androidlog  "log")
   elseif (UNIX)
     set (CSF_ThreadLibs  "pthread rt stdc++")
-    if (USE_GLES2)
-      set (CSF_OpenGlLibs  "EGL GLESv2")
-    else()
-      set (CSF_OpenGlLibs  "GL")
-    endif()
+    set (CSF_OpenGlLibs   "GL")
+    set (CSF_OpenGlesLibs "EGL GLESv2")
     set (CSF_XwLibs      "X11 Xext Xmu Xi")
     set (CSF_dl          "dl")
     set (CSF_fontconfig  "fontconfig")
index 12d6cd6..acbaac5 100644 (file)
@@ -303,6 +303,13 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
       else() # get CSF_ value
         set (CURRENT_CSF ${${USED_ITEM}})
         if (NOT "x${CURRENT_CSF}" STREQUAL "x")
+          if ("${CURRENT_CSF}" STREQUAL "CSF_OpenGlLibs")
+            add_definitions (-DHAVE_OPENGL)
+          endif()
+          if ("${CURRENT_CSF}" STREQUAL "CSF_OpenGlesLibs")
+            add_definitions (-DHAVE_GLES2)
+          endif()
+
           set (LIBRARY_FROM_CACHE 0)
           separate_arguments (CURRENT_CSF)
           foreach (CSF_LIBRARY ${CURRENT_CSF})
index 91b124f..19182d8 100644 (file)
@@ -174,9 +174,10 @@ set (USE_EGL_DESCR
 "Indicates whether EGL should be used in OCCT visualization
 module instead of conventional OpenGL context creation APIs")
 
+set (USE_OPENGL_DESCR
+"Indicates whether OpenGL desktop should be used in OCCT visualization module")
 set (USE_GLES2_DESCR
-"Indicates whether OpenGL ES 2.0 should be used in OCCT visualization
-module instead of desktop OpenGL")
+"Indicates whether OpenGL ES 2.0 should be used in OCCT visualization module")
 
 set (USE_TBB_DESCR
 "Indicates whether TBB is used or not. TBB stands for Threading Building Blocks,
index 5904281..fe11d4f 100644 (file)
@@ -1461,9 +1461,7 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
     set aLibsMap(CSF_netapi32)     "netapi32"
     set aLibsMap(CSF_winmm)        "winmm"
     set aLibsMap(CSF_OpenGlLibs)   "opengl32"
-    if { "$::HAVE_GLES2" == "true" } {
-      set aLibsMap(CSF_OpenGlLibs) "libEGL libGLESv2"
-    }
+    set aLibsMap(CSF_OpenGlesLibs) "libEGL libGLESv2"
     set aLibsMap(CSF_psapi)        "Psapi"
     set aLibsMap(CSF_d3d9)         "d3d9"
 
@@ -1484,14 +1482,18 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
     }
   } else {
     set aLibsMap(CSF_dl)           "dl"
+    set aLibsMap(CSF_OpenGlLibs)   "GL"
+    set aLibsMap(CSF_OpenGlesLibs) "EGL GLESv2"
     if { "$theOS" == "mac" || "$theOS" == "ios" } {
-      set aLibsMap(CSF_objc)       "objc"
+      set aLibsMap(CSF_objc)         "objc"
+      set aLibsMap(CSF_OpenGlLibs)   ""
+      set aLibsMap(CSF_OpenGlesLibs) ""
+      set aFrmsMap(CSF_OpenGlLibs)   "OpenGL"
+      set aFrmsMap(CSF_OpenGlesLibs) "OpenGLES"
       if { "$theOS" == "ios" } {
-        set aFrmsMap(CSF_Appkit)     "UIKit"
-        set aFrmsMap(CSF_OpenGlLibs) "OpenGLES"
+        set aFrmsMap(CSF_Appkit)   "UIKit"
       } else {
-        set aFrmsMap(CSF_Appkit)     "AppKit"
-        set aFrmsMap(CSF_OpenGlLibs) "OpenGL"
+        set aFrmsMap(CSF_Appkit)   "AppKit"
       }
       set aFrmsMap(CSF_IOKit)      "IOKit"
       set aFrmsMap(CSF_TclLibs)    "Tcl"
@@ -1500,24 +1502,17 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap theRelease} {
       set aLibsMap(CSF_TclTkLibs)  ""
       set aLibsMap(CSF_QT)         "QtCore QtGui"
     } elseif { "$theOS" == "android" } {
-      set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
       set aLibsMap(CSF_androidlog) "log"
     } else {
       set aLibsMap(CSF_fontconfig) "fontconfig"
       if { "$theOS" == "qnx" } {
         # CSF_ThreadLibs - pthread API is part of libc on QNX
-        set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
       } else {
         set aLibsMap(CSF_ThreadLibs) "pthread rt"
-        set aLibsMap(CSF_OpenGlLibs) "GL"
         set aLibsMap(CSF_TclTkLibs)  "X11 tk8.6"
         set aLibsMap(CSF_XwLibs)     "X11 Xext Xmu Xi"
         set aLibsMap(CSF_MotifLibs)  "X11"
       }
-
-      if { "$::HAVE_GLES2" == "true" } {
-        set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
-      }
     }
   }
 }
@@ -1785,9 +1780,14 @@ proc osutils:vcproj { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
   global path
 
   set aHasQtDep "false"
+  set aTkDefines ""
   foreach aCsfElem [osutils:tk:csfInExternlib "$path/$theSrcDir/${theToolKit}/EXTERNLIB"] {
     if { "$aCsfElem" == "CSF_QT" } {
       set aHasQtDep "true"
+    } elseif { "$aCsfElem" == "CSF_OpenGlLibs" } {
+      set aTkDefines "$aTkDefines;HAVE_OPENGL"
+    } elseif { "$aCsfElem" == "CSF_OpenGlesLibs" } {
+      set aTkDefines "$aTkDefines;HAVE_GLES2"
     }
   }
   set theProjTmpl [osutils:vcproj:readtemplate $theVcVer $isUWP 0]
@@ -1822,9 +1822,9 @@ proc osutils:vcproj { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
   # depending on VC version
   regsub -all -- {__TKDEP__} $theProjTmpl [osutils:depLibraries $aUsedLibs $anOsReleaseLibs $theVcVer] theProjTmpl
   regsub -all -- {__TKDEP_DEBUG__} $theProjTmpl [osutils:depLibraries $aUsedLibs $anOsDebugLibs $theVcVer] theProjTmpl
+  regsub -all -- {__TKDEFINES__} $theProjTmpl $aTkDefines theProjTmpl
 
   set anIncPaths "..\\..\\..\\inc"
-#  set aTKDefines ""
   set aFilesSection ""
   set aVcFilesCxx(units) ""
   set aVcFilesHxx(units) ""
@@ -2108,6 +2108,7 @@ proc osutils:vcprojx { theVcVer isUWP theOutDir theToolKit theGuidsMap theSrcDir
     set aVCRTVer [string range $theVcVer 0 3]
     regsub -all -- {__TKDEP__} $aProjTmpl [osutils:depLibraries $aUsedLibs $anOsReleaseLibs $theVcVer] aProjTmpl
     regsub -all -- {__TKDEP_DEBUG__} $aProjTmpl [osutils:depLibraries $aUsedLibs $anOsDebugLibs $theVcVer] aProjTmpl
+    regsub -all -- {__TKDEFINES__} $aProjTmpl "" aProjTmpl
 
     set aFilesSection ""
     set aVcFilesCxx(units) ""
index d855028..85c837f 100644 (file)
@@ -153,5 +153,4 @@ win32 {
   }
 }
 
-#OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}/$${TARGET}
-OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}
+OBJECTS_DIR = $$DESTDIR/../obj$${MY_BUILDTYPE}/$${TARGET}
index 84f2357..1fcd67f 100644 (file)
@@ -15,9 +15,14 @@ for (aModuleIter, aModuleList) {
       equals (aToolKit, $$OCC_MODULE_NAME)      { toSkipToolkit = 1 }
       !HAVE_VTK:equals (aToolKit, "TKIVtk")     { toSkipToolkit = 1 }
       !HAVE_VTK:equals (aToolKit, "TKIVtkDraw") { toSkipToolkit = 1 }
+      #!HAVE_OPENGL: equals (aToolKit, "TKOpenGl")       { toSkipToolkit = 1 }
+      #!HAVE_OPENGL: equals (aToolKit, "TKOpenGlTest")   { toSkipToolkit = 1 }
+      !HAVE_GLES2:   equals (aToolKit, "TKOpenGles")     { toSkipToolkit = 1 }
+      !HAVE_GLES2:   equals (aToolKit, "TKOpenGlesTest") { toSkipToolkit = 1 }
       !win32:   equals (aToolKit, "TKD3DHost")  { toSkipToolkit = 1 }
       !win32:   equals (aToolKit, "TKD3DHostTest") { toSkipToolkit = 1 }
       equals (toSkipToolkit, 0) {
+
         #warning(aToolKit($$OCC_MODULE_NAME)=$$aToolKit)
         eval(occtkgen_$${aToolKit}.input  = $$_PRO_FILE_PWD_/../OccToolkit.pro.in)
         eval(occtkgen_$${aToolKit}.output = $$_PRO_FILE_PWD_/$${aToolKit}/$${aToolKit}.pro)
index abe95b5..c7398ae 100644 (file)
@@ -36,7 +36,7 @@ win32 {
   CSF_wsock32    = -lwsock32
   CSF_netapi32   = -lnetapi32
   CSF_OpenGlLibs = -lopengl32
-  HAVE_GLES2 { CSF_OpenGlLibs = -llibEGL -llibGLESv2 }
+  CSF_OpenGlesLibs = -llibEGL -llibGLESv2
   CSF_psapi      = -lPsapi
   CSF_winmm      = -lwinmm
   CSF_d3d9       = -ld3d9
@@ -46,12 +46,12 @@ win32 {
 } else:mac {
   CSF_dl         = -ldl
   CSF_objc       = -lobjc
+  CSF_OpenGlLibs = -framework OpenGL
+  CSF_OpenGlesLibs = -framework OpenGLES
   iphoneos {
     CSF_Appkit     = -framework UIKit
-    CSF_OpenGlLibs = -framework OpenGLES
   } else {
     CSF_Appkit     = -framework AppKit
-    CSF_OpenGlLibs = -framework OpenGL
   }
   CSF_IOKit      = -framework IOKit
   CSF_TclLibs    = -framework Tcl
@@ -60,17 +60,19 @@ win32 {
   CSF_dl = -ldl
   CSF_ThreadLibs = -lpthread -lrt
   CSF_OpenGlLibs = -lGL
+  CSF_OpenGlesLibs = -lEGL -lGLESv2
   CSF_TclTkLibs  = -lX11 -ltk8.6
   CSF_XwLibs     = -lX11 -lXext -lXmu -lXi
   CSF_MotifLibs  = -lX11
   CSF_fontconfig = -lfontconfig
-  HAVE_GLES2 { CSF_OpenGlLibs = -lEGL -lGLESv2 }
 }
 
 for (aCfgIter, CONFIG) {
   aRes = $$find(aCfgIter, "^HAVE_")
-  count(aRes, 1) {
-    DEFINES += $$aCfgIter
+  !equals(aCfgIter, "HAVE_GLES2") {
+    count(aRes, 1) {
+      DEFINES += $$aCfgIter
+    }
   }
 }
 
@@ -103,6 +105,12 @@ for (anExternLib, anExternLibs) {
   count(hasCsf, 1) {
     aList = $$split($$anExternLib, "\n")
     LIBS += $$aList
+    equals(anExternLib, "CSF_OpenGlLibs") {
+      DEFINES += "HAVE_OPENGL"
+    }
+    equals(anExternLib, "CSF_OpenGlesLibs") {
+      DEFINES += "HAVE_GLES2"
+    }
   } else {
     LIBS += -l$$anExternLib
   }
index 203e972..4b26b4c 100644 (file)
@@ -185,7 +185,7 @@ if ["%HAVE_OPENCL%"]    == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DH
 if ["%HAVE_FREEIMAGE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE" & set "CSF_DEFINES=HAVE_FREEIMAGE;%CSF_DEFINES%"
 if ["%HAVE_FFMPEG%"]    == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FFMPEG"    & set "CSF_DEFINES=HAVE_FFMPEG;%CSF_DEFINES%"
 if ["%HAVE_VTK%"]       == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_VTK"       & set "CSF_DEFINES=HAVE_VTK;%CSF_DEFINES%"
-if ["%HAVE_GLES2%"]     == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GLES2"     & set "CSF_DEFINES=HAVE_GLES2;%CSF_DEFINES%"
+if ["%HAVE_GLES2%"]     == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GLES2_EXT" & set "CSF_DEFINES=HAVE_GLES2_EXT;%CSF_DEFINES%"
 if ["%HAVE_D3D%"]       == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_D3D"       & set "CSF_DEFINES=HAVE_D3D;%CSF_DEFINES%"
 if ["%HAVE_ZLIB%"]      == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_ZLIB"      & set "CSF_DEFINES=HAVE_ZLIB;%CSF_DEFINES%"
 if ["%HAVE_LIBLZMA%"]   == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_LIBLZMA"   & set "CSF_DEFINES=HAVE_LIBLZMA;%CSF_DEFINES%"
index 578b3ef..91a5931 100644 (file)
@@ -102,7 +102,7 @@ if [ "$HAVE_TBB"       == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -D
 if [ "$HAVE_OPENCL"    == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_OPENCL"; fi
 if [ "$HAVE_FREEIMAGE" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FREEIMAGE"; fi
 if [ "$HAVE_FFMPEG"    == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FFMPEG"; fi
-if [ "$HAVE_GLES2"     == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GLES2"; fi
+if [ "$HAVE_GLES2"     == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GLES2_EXT"; fi
 if [ "$HAVE_VTK"       == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"; fi
 if [ "$HAVE_ZLIB"      == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_ZLIB"; fi
 if [ "$HAVE_LIBLZMA"   == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_LIBLZMA"; fi
index a7a2063..1587334 100644 (file)
@@ -90,7 +90,7 @@
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>MaxSpeed</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     </ClCompile>
     <ResourceCompile>
       <AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NDEBUG;No_Exception;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
     <Link>
       <AdditionalDependencies>__TKDEP__</AdditionalDependencies>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>Disabled</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <AssemblerListingLocation>.\..\..\..\win32\__VCVER__\objd\__TKNAM__/</AssemblerListingLocation>
     </ClCompile>
     <ResourceCompile>
       <AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_DEBUG;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
     <Link>
       <AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>MaxSpeed</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     </ClCompile>
     <ResourceCompile>
       <AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NDEBUG;No_Exception;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
     <Link>
       <AdditionalDependencies>__TKDEP__</AdditionalDependencies>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>Disabled</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <AssemblerListingLocation>.\..\..\..\win64\__VCVER__\objd\__TKNAM__/</AssemblerListingLocation>
     </ClCompile>
     <ResourceCompile>
       <AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_DEBUG;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
     <Link>
       <AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
index 08dc4bb..07f9c75 100644 (file)
@@ -85,7 +85,7 @@
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>MaxSpeed</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     </ClCompile>
     <ResourceCompile>
       <AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NDEBUG;No_Exception;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
     <Link>
       <AdditionalDependencies>__TKDEP__</AdditionalDependencies>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>Disabled</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <AssemblerListingLocation>.\..\..\..\win32\__VCVER__\objd\__XQTNAM__/</AssemblerListingLocation>
     </ClCompile>
     <ResourceCompile>
       <AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_DEBUG;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
     <Link>
       <AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>MaxSpeed</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NDEBUG;No_Exception;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     </ClCompile>
     <ResourceCompile>
       <AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>NDEBUG;No_Exception;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NDEBUG;No_Exception;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
     <Link>
       <AdditionalDependencies>__TKDEP__</AdditionalDependencies>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <Optimization>Disabled</Optimization>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>Async</ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <AssemblerListingLocation>.\..\..\..\win64\__VCVER__\objd\__XQTNAM__/</AssemblerListingLocation>
     </ClCompile>
     <ResourceCompile>
       <AdditionalIncludeDirectories>..\..\..\inc;$(CSF_OPT_INC);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_DEBUG;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>_DEBUG;__TKDEFINES__;$(CSF_DEFINES);%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ResourceCompile>
     <Link>
       <AdditionalDependencies>__TKDEP_DEBUG__</AdditionalDependencies>
index 5479175..d41c636 100644 (file)
@@ -2229,3 +2229,11 @@ Existing code defining nodal colors should be updated to:
 - Use *Graphic3d_TOSM_UNLIT* shading model when lighting is not needed.
 - Adjust diffuse/ambient material coefficients, which have been previously ignored.
 - Remove code multiplying nodal colors, intended to compensate over-brightness due to addition of specular color from material definition, as specular component is now also modulated by a vertex color.
+
+@subsection upgrade_occt760_tkopengles TKOpenGles library
+
+OCCT now provides two separate toolkits - *TKOpenGl* depending on desktop OpenGL and *TKOpenGles* depending on OpenGL ES.
+Both libraries can be now built simultaneously on systems providing both APIs (like desktop Linux).
+
+Existing applications depending on OpenGL ES (mobile projects first of all) should be adjusted to link against *TKOpenGles*.
+Note that both *TKOpenGl* and *TKOpenGles* keep exporting classes with the same name, so applications should not attempt to link both libraries simultaneously.
index 83043d9..a83efb4 100644 (file)
@@ -32,7 +32,7 @@
                0A7DEE351E2D2AE000267B9B /* libTKXCAF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE151E2D2AC000267B9B /* libTKXCAF.a */; };
                0A7DEE371E2D2AE000267B9B /* libTKXDESTEP.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE171E2D2AC700267B9B /* libTKXDESTEP.a */; };
                0A7DEE3E1E2D2B8100267B9B /* libTKBO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE021E2D2A7F00267B9B /* libTKBO.a */; };
-               0A7DEE3F1E2D2BB000267B9B /* libTKOpenGl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE091E2D2A9700267B9B /* libTKOpenGl.a */; };
+               0A7DEE3F1E2D2BB000267B9B /* libTKOpenGles.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE091E2D2A9700267B9B /* libTKOpenGles.a */; };
                0A7DEE401E2D2BEA00267B9B /* libTKSTEP209.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE0F1E2D2AAB00267B9B /* libTKSTEP209.a */; };
                0A7DEE411E2D2C1500267B9B /* libTKXSBase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0A7DEE1D1E2D2ADC00267B9B /* libTKXSBase.a */; };
                0AAE0DE61EAF816E00C1F65B /* screw.step in Resources */ = {isa = PBXBuildFile; fileRef = 0AAE0DE51EAF816D00C1F65B /* screw.step */; };
@@ -82,7 +82,7 @@
                0A7DEE061E2D2A8C00267B9B /* libTKIGES.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKIGES.a; path = ../occt/lib/libTKIGES.a; sourceTree = "<group>"; };
                0A7DEE071E2D2A8F00267B9B /* libTKMeshVS.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKMeshVS.a; path = ../occt/lib/libTKMeshVS.a; sourceTree = "<group>"; };
                0A7DEE081E2D2A9300267B9B /* libTKOffset.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKOffset.a; path = ../occt/lib/libTKOffset.a; sourceTree = "<group>"; };
-               0A7DEE091E2D2A9700267B9B /* libTKOpenGl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKOpenGl.a; path = ../occt/lib/libTKOpenGl.a; sourceTree = "<group>"; };
+               0A7DEE091E2D2A9700267B9B /* libTKOpenGles.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKOpenGles.a; path = ../occt/lib/libTKOpenGles.a; sourceTree = "<group>"; };
                0A7DEE0A1E2D2A9A00267B9B /* libTKPrim.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKPrim.a; path = ../occt/lib/libTKPrim.a; sourceTree = "<group>"; };
                0A7DEE0B1E2D2A9D00267B9B /* libTKService.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKService.a; path = ../occt/lib/libTKService.a; sourceTree = "<group>"; };
                0A7DEE0C1E2D2AA100267B9B /* libTKStd.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libTKStd.a; path = ../occt/lib/libTKStd.a; sourceTree = "<group>"; };
                                0AE286641EB0D29B00A9D719 /* libz.tbd in Frameworks */,
                                0A7DEE411E2D2C1500267B9B /* libTKXSBase.a in Frameworks */,
                                0A7DEE401E2D2BEA00267B9B /* libTKSTEP209.a in Frameworks */,
-                               0A7DEE3F1E2D2BB000267B9B /* libTKOpenGl.a in Frameworks */,
+                               0A7DEE3F1E2D2BB000267B9B /* libTKOpenGles.a in Frameworks */,
                                0A7DEE3E1E2D2B8100267B9B /* libTKBO.a in Frameworks */,
                                0A7DEE2B1E2D2AE000267B9B /* libTKService.a in Frameworks */,
                                0A7DEE2E1E2D2AE000267B9B /* libTKSTEP.a in Frameworks */,
                                0A7DEE061E2D2A8C00267B9B /* libTKIGES.a */,
                                0A7DEE071E2D2A8F00267B9B /* libTKMeshVS.a */,
                                0A7DEE081E2D2A9300267B9B /* libTKOffset.a */,
-                               0A7DEE091E2D2A9700267B9B /* libTKOpenGl.a */,
+                               0A7DEE091E2D2A9700267B9B /* libTKOpenGles.a */,
                                0A7DEE0A1E2D2A9A00267B9B /* libTKPrim.a */,
                                0A7DEE0B1E2D2A9D00267B9B /* libTKService.a */,
                                0A7DEE0C1E2D2AA100267B9B /* libTKStd.a */,
index 83a3e2b..b92c4ae 100644 (file)
@@ -147,7 +147,7 @@ public class OcctJniActivity extends Activity implements OnClickListener
      || !loadLibVerbose ("TKService",    aLoaded, aFailed)
      || !loadLibVerbose ("TKHLR",        aLoaded, aFailed)
      || !loadLibVerbose ("TKV3d",        aLoaded, aFailed)
-     || !loadLibVerbose ("TKOpenGl",     aLoaded, aFailed)
+     || !loadLibVerbose ("TKOpenGles",   aLoaded, aFailed)
         // application code
      || !loadLibVerbose ("TKJniSample",  aLoaded, aFailed))
     {
index 4862495..59e131d 100644 (file)
@@ -11,7 +11,7 @@ set (anOcctLibs
   TKIGES
   TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP
   # OCCT Visualization
-  TKService TKHLR TKV3d TKOpenGl
+  TKService TKHLR TKV3d TKOpenGles
 )
 
 set(aLibDeps "")
index 2a5e52a..c8773d3 100644 (file)
@@ -38,7 +38,7 @@ LIBS += -lTKernel \
         -lTKMesh \
         -lTKHLR \
         -lTKV3d \
-        -lTKOpenGl
+        -lTKOpenGles
 
 # IMPORTANT. load libraries in a proper order
 ANDROID_EXTRA_LIBS =  $$3rdparty_lib_path/libfreeimage.so \
@@ -56,4 +56,4 @@ ANDROID_EXTRA_LIBS =  $$3rdparty_lib_path/libfreeimage.so \
                       $$occt_lib_path/libTKMesh.so \
                       $$occt_lib_path/libTKHLR.so \
                       $$occt_lib_path/libTKV3d.so \
-                      $$occt_lib_path/libTKOpenGl.so
+                      $$occt_lib_path/libTKOpenGles.so
index a3d7ef3..1f7d3af 100644 (file)
@@ -64,7 +64,7 @@ else()
   set(OCCT_BIN_DIR)
 endif()
 
-set(OpenCASCADE_LIBS TKRWMesh TKBinXCAF TKBin TKBinL TKOpenGl TKXCAF TKVCAF TKCAF TKV3d TKHLR TKMesh TKService TKShHealing TKPrim TKTopAlgo TKGeomAlgo TKBRep TKGeomBase TKG3d TKG2d TKMath TKLCAF TKCDF TKernel)
+set(OpenCASCADE_LIBS TKRWMesh TKBinXCAF TKBin TKBinL TKOpenGles TKXCAF TKVCAF TKCAF TKV3d TKHLR TKMesh TKService TKShHealing TKPrim TKTopAlgo TKGeomAlgo TKBRep TKGeomBase TKG3d TKG2d TKMath TKLCAF TKCDF TKernel)
 
 add_executable(${APP_TARGET} ${SOURCES})
 target_link_libraries(
index ec8e5f7..c1a30ea 100644 (file)
@@ -710,7 +710,7 @@ EM_BOOL WasmOcctView::onTouchEvent (int theEventType, const EmscriptenTouchEvent
               myDoubleTapTimer.Stop();
               myDoubleTapTimer.Reset();
               myDoubleTapTimer.Start();
-              SelectInViewer (Graphic3d_Vec2i (myClickTouch.From), false);
+              SelectInViewer (Graphic3d_Vec2i (myClickTouch.From), AIS_SelectionScheme_Replace);
             }
           }
           hasUpdates = true;
index 0270aaf..138e883 100644 (file)
@@ -358,10 +358,11 @@ static Standard_Integer dversion(Draw_Interpretor& di, Standard_Integer, const c
 #else
   di << "FFmpeg disabled\n";
 #endif
-#ifdef HAVE_GLES2
-  di << "OpenGL: ES2\n";
-#else
-  di << "OpenGL: desktop\n";
+#ifdef HAVE_OPENGL_EXT
+  di << "OpenGL: enabled (HAVE_OPENGL_EXT)\n";
+#endif
+#ifdef HAVE_GLES2_EXT
+  di << "OpenGL ES: enabled (HAVE_GLES2_EXT)\n";
 #endif
 #ifdef HAVE_OPENVR
   di << "OpenVR enabled (HAVE_OPENVR)\n";
index f0325d9..b9938be 100755 (executable)
@@ -42,7 +42,10 @@ ALL                : MODELING, OCAFKERNEL, DATAEXCHANGE
 TOPTEST            : TKTopTest
 DCAF               : TKDCAF
 AISV               : TKViewerTest
+GL                 : TKOpenGlTest
 OPENGL             : TKOpenGlTest
+GLES               : TKOpenGlesTest
+OPENGLES           : TKOpenGlesTest
 D3DHOST            : TKD3DHostTest
 XSDRAW             : TKXSDRAW
 XDEDRAW            : TKXDEDRAW
index bfd7c72..a72770b 100644 (file)
@@ -18,6 +18,9 @@ proc Draw:toolkits { } {
   set aResult [list TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw]
 
   lappend aResult "TKOpenGlTest"
+  if { [info exists ::env(HAVE_GLES2)] && "$::env(HAVE_GLES2)" == "true" } {
+    lappend aResult "TKOpenGlesTest"
+  }
   if { "$::tcl_platform(platform)" == "windows" } {
     if { [info exists ::env(HAVE_D3D)] } {
       if { "$::env(HAVE_D3D)" == "true" } {
index 05928f6..cf881b5 100644 (file)
@@ -18,6 +18,9 @@ proc Visualization:toolkits { } {
   set aResult [list TKService TKV3d TKMeshVS]
 
   lappend aResult "TKOpenGl"
+  if { [info exists ::env(HAVE_GLES2)] && "$::env(HAVE_GLES2)" == "true" } {
+    lappend aResult "TKOpenGles"
+  }
   if { "$::tcl_platform(platform)" == "windows" } {
     if { [info exists ::env(HAVE_D3D)] } {
       if { "$::env(HAVE_D3D)" == "true" } {
index f05d316..e212d64 100644 (file)
@@ -145,15 +145,18 @@ OpenGl_GraphicDriver::OpenGl_GraphicDriver (const Handle(Aspect_DisplayConnectio
                                             const Standard_Boolean                  theToInitialize)
 : Graphic3d_GraphicDriver (theDisp),
   myIsOwnContext (Standard_False),
-#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__)
-  myEglDisplay ((Aspect_Display )EGL_NO_DISPLAY),
-  myEglContext ((Aspect_RenderingContext )EGL_NO_CONTEXT),
+  myEglDisplay (NULL),
+  myEglContext (NULL),
   myEglConfig  (NULL),
-#endif
   myCaps           (new OpenGl_Caps()),
   myMapOfView      (1, NCollection_BaseAllocator::CommonBaseAllocator()),
   myMapOfStructure (1, NCollection_BaseAllocator::CommonBaseAllocator())
 {
+#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__)
+  myEglDisplay = (Aspect_Display )EGL_NO_DISPLAY;
+  myEglContext = (Aspect_RenderingContext )EGL_NO_CONTEXT;
+#endif
+
 #if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
   if (myDisplayConnection.IsNull())
   {
@@ -354,7 +357,6 @@ Standard_Boolean OpenGl_GraphicDriver::InitContext()
   return Standard_True;
 }
 
-#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__)
 // =======================================================================
 // function : InitEglContext
 // purpose  :
@@ -364,6 +366,7 @@ Standard_Boolean OpenGl_GraphicDriver::InitEglContext (Aspect_Display          t
                                                        void*                   theEglConfig)
 {
   ReleaseContext();
+#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__)
 #if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && !defined(__EMSCRIPTEN__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
   if (myDisplayConnection.IsNull())
   {
@@ -390,8 +393,13 @@ Standard_Boolean OpenGl_GraphicDriver::InitEglContext (Aspect_Display          t
   }
   chooseVisualInfo();
   return Standard_True;
-}
+#else
+  (void )theEglDisplay;
+  (void )theEglContext;
+  (void )theEglConfig;
+  throw Standard_NotImplemented ("OpenGl_GraphicDriver::InitEglContext() is not implemented");
 #endif
+}
 
 // =======================================================================
 // function : chooseVisualInfo
index 3e11dec..b8ceb33 100644 (file)
@@ -68,7 +68,6 @@ public:
   //! Perform initialization of default OpenGL context.
   Standard_EXPORT Standard_Boolean InitContext();
 
-#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__)
   //! Initialize default OpenGL context using existing one.
   //! @param theEglDisplay EGL connection to the Display
   //! @param theEglContext EGL rendering context
@@ -76,7 +75,6 @@ public:
   Standard_EXPORT Standard_Boolean InitEglContext (Aspect_Display          theEglDisplay,
                                                    Aspect_RenderingContext theEglContext,
                                                    void*                   theEglConfig);
-#endif
 
   //! Request limit of graphic resource of specific type.
   Standard_EXPORT virtual Standard_Integer InquireLimit (const Graphic3d_TypeOfLimit theType) const Standard_OVERRIDE;
@@ -175,11 +173,9 @@ public:
   //!                 any context will be returned otherwise
   Standard_EXPORT const Handle(OpenGl_Context)& GetSharedContext (bool theBound = false) const;
 
-#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__)
   Aspect_Display          getRawGlDisplay() const { return myEglDisplay; }
   Aspect_RenderingContext getRawGlContext() const { return myEglContext;  }
   void*                   getRawGlConfig()  const { return myEglConfig; }
-#endif
 
   //! Set device lost flag for redrawn views.
   Standard_EXPORT void setDeviceLost();
@@ -200,11 +196,10 @@ protected:
 protected:
 
   Standard_Boolean        myIsOwnContext; //!< indicates that shared context has been created within OpenGl_GraphicDriver
-#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__) || defined(__EMSCRIPTEN__)
+
   Aspect_Display          myEglDisplay;   //!< EGL connection to the Display : EGLDisplay
   Aspect_RenderingContext myEglContext;   //!< EGL rendering context         : EGLContext
   void*                   myEglConfig;    //!< EGL configuration             : EGLConfig
-#endif
 
   Handle(OpenGl_Caps)                                      myCaps;
   NCollection_Map<Handle(OpenGl_View)>                     myMapOfView;
index cdc72c3..9f6a6a7 100644 (file)
 
 #include <OpenGl_GraphicDriver.hxx>
 
+#ifdef HAVE_GLES2
+  #define OpenGl_DRIVER_NAME "TKOpenGles"
+#else
+  #define OpenGl_DRIVER_NAME "TKOpenGl"
+#endif
+
 IMPLEMENT_STANDARD_RTTIEXT(OpenGl_GraphicDriverFactory, Graphic3d_GraphicDriverFactory)
 
 // =======================================================================
@@ -22,7 +28,7 @@ IMPLEMENT_STANDARD_RTTIEXT(OpenGl_GraphicDriverFactory, Graphic3d_GraphicDriverF
 // purpose  :
 // =======================================================================
 OpenGl_GraphicDriverFactory::OpenGl_GraphicDriverFactory()
-: Graphic3d_GraphicDriverFactory ("TKOpenGl"),
+: Graphic3d_GraphicDriverFactory (OpenGl_DRIVER_NAME),
   myDefaultCaps (new OpenGl_Caps())
 {
   //
diff --git a/src/TKOpenGles/CMakeLists.txt b/src/TKOpenGles/CMakeLists.txt
new file mode 100644 (file)
index 0000000..097b28b
--- /dev/null
@@ -0,0 +1,4 @@
+project(TKOpenGles)
+
+OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
+#add_definitions("-DOCCT_OPENGL")
diff --git a/src/TKOpenGles/EXTERNLIB b/src/TKOpenGles/EXTERNLIB
new file mode 100644 (file)
index 0000000..431d1db
--- /dev/null
@@ -0,0 +1,12 @@
+TKernel
+TKService
+TKMath
+CSF_TBB
+CSF_FREETYPE
+CSF_OpenGlesLibs
+CSF_user32
+CSF_gdi32
+CSF_XwLibs
+CSF_Appkit
+CSF_IOKit
+CSF_objc
diff --git a/src/TKOpenGles/FILES b/src/TKOpenGles/FILES
new file mode 100644 (file)
index 0000000..b635bba
--- /dev/null
@@ -0,0 +1,3 @@
+DEFINES
+EXTERNLIB
+PACKAGES
diff --git a/src/TKOpenGles/PACKAGES b/src/TKOpenGles/PACKAGES
new file mode 100644 (file)
index 0000000..ba04012
--- /dev/null
@@ -0,0 +1 @@
+OpenGl
diff --git a/src/TKOpenGlesTest/CMakeLists.txt b/src/TKOpenGlesTest/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ea6e856
--- /dev/null
@@ -0,0 +1,3 @@
+project(TKOpenGlesTest)
+
+OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
diff --git a/src/TKOpenGlesTest/EXTERNLIB b/src/TKOpenGlesTest/EXTERNLIB
new file mode 100644 (file)
index 0000000..875d0a6
--- /dev/null
@@ -0,0 +1,8 @@
+TKernel
+TKMath
+TKDraw
+TKOpenGles
+TKService
+TKV3d
+TKViewerTest
+CSF_OpenGlesLibs
diff --git a/src/TKOpenGlesTest/FILES b/src/TKOpenGlesTest/FILES
new file mode 100644 (file)
index 0000000..ca4f0e5
--- /dev/null
@@ -0,0 +1,2 @@
+EXTERNLIB
+PACKAGES
diff --git a/src/TKOpenGlesTest/PACKAGES b/src/TKOpenGlesTest/PACKAGES
new file mode 100644 (file)
index 0000000..4df696d
--- /dev/null
@@ -0,0 +1 @@
+OpenGlTest
index f206d00..21ed553 100644 (file)
@@ -1688,7 +1688,12 @@ TCollection_AsciiString ViewerTest::ViewerInit (const Standard_Integer thePxLeft
     aFactory = Graphic3d_GraphicDriverFactory::DefaultDriverFactory();
     if (aFactory.IsNull())
     {
-      throw Standard_ProgramError("Error: no graphic driver factory found");
+      Draw::GetInterpretor().Eval ("pload GLES");
+      aFactory = Graphic3d_GraphicDriverFactory::DefaultDriverFactory();
+      if (aFactory.IsNull())
+      {
+        throw Standard_ProgramError("Error: no graphic driver factory found");
+      }
     }
   }
 
@@ -2020,6 +2025,12 @@ static int VDriver (Draw_Interpretor& theDi, Standard_Integer theArgsNb, const c
     {
       aNewActive = "tkopengl";
     }
+    else if (TCollection_AsciiString::IsSameString (aNewActive, "gles", false)
+          || TCollection_AsciiString::IsSameString (aNewActive, "opengles", false)
+          || TCollection_AsciiString::IsSameString (aNewActive, "tkopengles", false))
+    {
+      aNewActive = "tkopengles";
+    }
     else if (TCollection_AsciiString::IsSameString (aNewActive, "d3d", false)
           || TCollection_AsciiString::IsSameString (aNewActive, "d3dhost", false)
           || TCollection_AsciiString::IsSameString (aNewActive, "tkd3dhost", false))
@@ -2033,6 +2044,10 @@ static int VDriver (Draw_Interpretor& theDi, Standard_Integer theArgsNb, const c
       {
         Draw::GetInterpretor().Eval ("pload OPENGL");
       }
+      else if (aNewActive == "tkopengles")
+      {
+        Draw::GetInterpretor().Eval ("pload GLES");
+      }
       else if (aNewActive == "tkd3dhost")
       {
         Draw::GetInterpretor().Eval ("pload D3DHOST");
diff --git a/tests/v3d/glsl/opengles b/tests/v3d/glsl/opengles
new file mode 100644 (file)
index 0000000..4e3e53a
--- /dev/null
@@ -0,0 +1,22 @@
+puts "============"
+puts "0032206: Visualization, TKOpenGl - move out OpenGL ES support to dedicated library TKOpenGles"
+puts "============"
+puts ""
+
+set to_dump_screen 0
+pload MODELING VISUALIZATION
+vdriver -load GLES
+vclear
+vinit View1
+box b 3 0 0 1 2 3
+psphere s 1
+vdisplay -dispMode 1 b s
+set anInfo [vglinfo]
+if { [regexp {OpenGL ES} $anInfo] } {
+  puts "OK: OpenGL ES has been found"
+} else {
+  puts "Error: OpenGL ES is expected"
+}
+vfit
+vrenderparams -shadingModel PHONG
+vdump ${imagedir}/${casename}.png