OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
endif()
+# OpenGL ES 2.0
+OCCT_IS_PRODUCT_REQUIRED (CSF_OpenGlLibs CAN_USE_GLES2)
+if (WIN32 AND CAN_USE_GLES2)
+ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
+ set (USE_GLES2 ON)
+ else()
+ set (USE_GLES2 OFF CACHE BOOL "${USE_GLES2_DESCR}")
+ endif()
+
+ if (USE_GLES2)
+ add_definitions (-DHAVE_GLES2)
+ OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/egl")
+ OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/gles2")
+ else()
+ OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL")
+ OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2")
+ OCCT_CHECK_AND_UNSET ("INSTALL_EGL")
+ OCCT_CHECK_AND_UNSET ("INSTALL_GLES2")
+ endif()
+else()
+ OCCT_CHECK_AND_UNSET ("USE_GLES2")
+
+ OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EGL")
+ OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_GLES2")
+ OCCT_CHECK_AND_UNSET ("INSTALL_EGL")
+ OCCT_CHECK_AND_UNSET ("INSTALL_GLES2")
+endif()
+
# GL2PS
# search for CSF_GL2PS variable in EXTERNLIB of each being used toolkit
OCCT_IS_PRODUCT_REQUIRED (CSF_GL2PS CAN_USE_GL2PS)
--- /dev/null
+# EGL
+if (WIN32)
+ THIRDPARTY_PRODUCT("EGL" "EGL/egl.h" "libEGL" "libEGL")
+else()
+ THIRDPARTY_PRODUCT("EGL" "EGL/egl.h" "EGL" "EGL")
+endif()
--- /dev/null
+# OpenGL ES 2.0
+if (WIN32)
+ THIRDPARTY_PRODUCT("GLES2" "GLES2/gl2.h" "libGLESv2" "libGLESv2")
+else()
+ THIRDPARTY_PRODUCT("GLES2" "GLES2/gl2.h" "GLESv2" "GLESv2")
+endif()
set (CSF_winspool "Winspool.lib")
set (CSF_psapi "Psapi.lib")
set (CSF_AviLibs "ws2_32.lib vfw32.lib")
- set (CSF_OpenGlLibs "opengl32.lib")
+ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" OR USE_GLES2)
+ set (CSF_OpenGlLibs "libEGL.lib libGLESv2.lib")
+ else()
+ set (CSF_OpenGlLibs "opengl32.lib")
+ endif()
if (USE_FREETYPE)
set (CSF_FREETYPE "freetype.lib")
if (WIN32)
if (NOT 3RDPARTY_TCL_DLL)
- set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll)
+ set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TCL_DLL_DIR)
if (WIN32)
if (NOT 3RDPARTY_TCL_DLL)
- set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll)
+ set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll .a)
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TCL_DLL_DIR)
if (WIN32)
if (NOT 3RDPARTY_TK_DLL)
- set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
+ set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll" ".a")
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TK_DLL_DIR)
if (WIN32)
if (NOT 3RDPARTY_TK_DLL)
- set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
+ set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll" ".a")
set (DLL_FOLDER_FOR_SEARCH "")
if (3RDPARTY_TK_DLL_DIR)
INSTALL_MESSAGE (INSTALL_TEST_CASES "non-regression OCCT test scripts")
INSTALL_MESSAGE (INSTALL_DOC_Overview "OCCT overview documentation (HTML format)")
INSTALL_MESSAGE (INSTALL_FREEIMAGE "FreeImage binaries")
+INSTALL_MESSAGE (INSTALL_EGL "EGL binaries")
+INSTALL_MESSAGE (INSTALL_GLES2 "OpenGL ES 2.0 binaries")
INSTALL_MESSAGE (INSTALL_FREETYPE "FreeType binaries")
INSTALL_MESSAGE (INSTALL_GL2PS "GL2PS binaries")
INSTALL_MESSAGE (INSTALL_TBB "TBB binaries")
"Indicates whether Freeimage product should be used in OCCT visualization
module for support of popular graphics image formats (PNG, BMP etc)")
+set (USE_EGL_DESCR
+"Indicates whether EGL should be used in OCCT visualization
+module instead of conventional OpenGL context creation APIs")
+
+set (USE_GLES2_DESCR
+"Indicates whether OpenGL ES 2.0 should be used in OCCT visualization
+module instead of desktop OpenGL")
+
set (USE_GL2PS_DESCR
"Indicates whether GL2PS product should be used in OCCT visualization
module for support of vector image formats (PS, EPS etc)")
macro (BUILD_MODULE MODULE_NAME)
set (ENABLE_MODULE TRUE)
- set (OCCT_MODULES_FOR_UWP FoundationClasses ModelingAlgorithms ModelingData)
+ set (OCCT_MODULES_FOR_UWP FoundationClasses ModelingAlgorithms ModelingData DataExchange Visualization)
list (FIND OCCT_MODULES_FOR_UWP ${OCCT_MODULE} CAN_BE_USED_IN_UWP)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" AND CAN_BE_USED_IN_UWP EQUAL -1)
set (ENABLE_MODULE FALSE)
wokdep:SearchTclTk anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
wokdep:SearchFreeType anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
wokdep:SearchX11 anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
+ if { "$::HAVE_GLES2" == "true" } {
+ if { "$::HAVE_GL2PS" == "true" } {
+ lappend anIncErrs "Error: gl2ps can not be used within OpenGL ES"
+ }
+ if { "$::HAVE_D3D" == "true" } {
+ lappend anIncErrs "Error: Direct3D can not be used within OpenGL ES"
+ }
+ wokdep:SearchEGL anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
+ wokdep:SearchGLES anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
+ }
if { "$::HAVE_FREEIMAGE" == "true" } {
wokdep:SearchFreeImage anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
}
ttk::label .myFrame.myChecks.myGl2psLbl -text "Use GL2PS"
checkbutton .myFrame.myChecks.myTbbCheck -offvalue "false" -onvalue "true" -variable HAVE_TBB -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myTbbLbl -text "Use Intel TBB"
+if { "$::tcl_platform(os)" != "Darwin" } {
+ checkbutton .myFrame.myChecks.myGlesCheck -offvalue "false" -onvalue "true" -variable HAVE_GLES2 -command wokdep:gui:UpdateList
+ ttk::label .myFrame.myChecks.myGlesLbl -text "Use OpenGL ES"
+}
if { "$::tcl_platform(platform)" == "windows" } {
checkbutton .myFrame.myChecks.myD3dCheck -offvalue "false" -onvalue "true" -variable HAVE_D3D -command wokdep:gui:UpdateList
ttk::label .myFrame.myChecks.myD3dLbl -text "Use Direct3D"
grid .myFrame.myChecks.myTbbLbl -row $aCheckRowIter -column 3 -sticky w
grid .myFrame.myChecks.myQt4Check -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myQt4Lbl -row $aCheckRowIter -column 5 -sticky w
-if { "$::tcl_platform(platform)" == "windows" } {
- grid .myFrame.myChecks.myD3dCheck -row $aCheckRowIter -column 6 -sticky e
- grid .myFrame.myChecks.myD3dLbl -row $aCheckRowIter -column 7 -sticky w
-}
+grid .myFrame.myChecks.myGlesCheck -row $aCheckRowIter -column 6 -sticky e
+grid .myFrame.myChecks.myGlesLbl -row $aCheckRowIter -column 7 -sticky w
#grid .myFrame.myChecks.myOpenClCheck -row $aCheckRowIter -column 6 -sticky e
#grid .myFrame.myChecks.myOpenClLbl -row $aCheckRowIter -column 7 -sticky w
incr aCheckRowIter
grid .myFrame.myChecks.myVtkLbl -row $aCheckRowIter -column 3 -sticky w
grid .myFrame.myChecks.myJDKCheck -row $aCheckRowIter -column 4 -sticky e
grid .myFrame.myChecks.myJDKLbl -row $aCheckRowIter -column 5 -sticky w
+if { "$::tcl_platform(platform)" == "windows" } {
+ grid .myFrame.myChecks.myD3dCheck -row $aCheckRowIter -column 6 -sticky e
+ grid .myFrame.myChecks.myD3dLbl -row $aCheckRowIter -column 7 -sticky w
+}
incr aCheckRowIter
if { "$::tcl_platform(os)" == "Darwin" } {
grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 0 -sticky e
set HAVE_GL2PS "false"
set HAVE_TBB "false"
set HAVE_D3D "false"
+set HAVE_GLES2 "false"
set HAVE_OPENCL "false"
set HAVE_VTK "false"
set MACOSX_USE_GLX "false"
if { [info exists ::env(HAVE_D3D)] } {
set HAVE_D3D "$::env(HAVE_D3D)"
}
+if { [info exists ::env(HAVE_GLES2)] } {
+ set HAVE_GLES2 "$::env(HAVE_GLES2)"
+}
if { [info exists ::env(HAVE_OPENCL)] } {
set HAVE_OPENCL "$::env(HAVE_OPENCL)"
}
return "$isFound"
}
+# Search EGL library placement
+proc wokdep:SearchEGL {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
+ upvar $theErrInc anErrInc
+ upvar $theErrLib32 anErrLib32
+ upvar $theErrLib64 anErrLib64
+ upvar $theErrBin32 anErrBin32
+ upvar $theErrBin64 anErrBin64
+
+ set isFound "true"
+ set aHeaderPath [wokdep:SearchHeader "EGL/egl.h"]
+ if { "$aHeaderPath" == "" } {
+ set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$::ARCH" ]
+ if { "$aPath" == "" || ![file exists "$aPath/include/EGL/egl.h"] } {
+ set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$::ARCH" ]
+ }
+
+ if { "$aPath" != "" && [file exists "$aPath/include/EGL/egl.h"] } {
+ lappend ::CSF_OPT_INC "$aPath/include"
+ } else {
+ lappend anErrInc "Error: 'EGL/egl.h' not found (EGL)"
+ set isFound "false"
+ }
+ }
+
+ set aLibName "EGL"
+ if { "$::tcl_platform(platform)" == "windows" } {
+ # awkward exception
+ set aLibName "libEGL"
+ }
+
+ foreach anArchIter {64 32} {
+ set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter"]
+ if { "$aLibPath" == "" } {
+ set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$anArchIter" ]
+ set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
+ if { "$aLibPath" == "" } {
+ set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
+ set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
+ }
+
+ if { "$aLibPath" != "" } {
+ lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
+ } else {
+ lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aLibName}.${::SYS_LIB_SUFFIX}' not found (EGL)"
+ if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
+ }
+ }
+
+ if { "$::tcl_platform(platform)" == "windows" } {
+ set aDllPath [wokdep:SearchBin "libEGL.dll" "$anArchIter"]
+ if { "$aDllPath" == "" } {
+ set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$anArchIter" ]
+ set aDllPath [wokdep:SearchBin "libEGL.dll" "$anArchIter" "$aPath/bin"]
+ if { "$aDllPath" == "" } {
+ set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
+ set aDllPath [wokdep:SearchBin "libEGL.dll" "$anArchIter" "$aPath/bin"]
+ }
+
+ if { "$aDllPath" != "" } {
+ lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
+ } else {
+ lappend anErrBin$anArchIter "Error: 'libEGL.dll' not found (EGL)"
+ if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
+ }
+ }
+ }
+ }
+
+ return "$isFound"
+}
+
+# Search OpenGL ES 2.0 library placement
+proc wokdep:SearchGLES {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
+ upvar $theErrInc anErrInc
+ upvar $theErrLib32 anErrLib32
+ upvar $theErrLib64 anErrLib64
+ upvar $theErrBin32 anErrBin32
+ upvar $theErrBin64 anErrBin64
+
+ set isFound "true"
+ set aHeaderPath [wokdep:SearchHeader "GLES2/gl2.h"]
+ if { "$aHeaderPath" == "" } {
+ set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{GLES}*] "$::VCVER" "$::ARCH" ]
+ if { "$aPath" == "" || ![file exists "$aPath/include/GLES2/gl2.h"] } {
+ set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$::ARCH" ]
+ }
+
+ if { "$aPath" != "" && [file exists "$aPath/include/GLES2/gl2.h"] } {
+ lappend ::CSF_OPT_INC "$aPath/include"
+ } else {
+ lappend anErrInc "Error: 'GLES2/gl2.h' not found (OpenGL ES 2.0)"
+ set isFound "false"
+ }
+ }
+
+ set aLibName "GLESv2"
+ if { "$::tcl_platform(platform)" == "windows" } {
+ # awkward exception
+ set aLibName "libGLESv2"
+ }
+
+ foreach anArchIter {64 32} {
+ set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter"]
+ if { "$aLibPath" == "" } {
+ set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{GLES}*] "$::VCVER" "$anArchIter" ]
+ set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
+ if { "$aLibPath" == "" } {
+ set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
+ set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
+ }
+
+ if { "$aLibPath" != "" } {
+ lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
+ } else {
+ lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aLibName}.${::SYS_LIB_SUFFIX}' not found (OpenGL ES 2.0)"
+ if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
+ }
+ }
+
+ if { "$::tcl_platform(platform)" == "windows" } {
+ set aDllPath [wokdep:SearchBin "libGLESv2.dll" "$anArchIter"]
+ if { "$aDllPath" == "" } {
+ set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$anArchIter" ]
+ set aDllPath [wokdep:SearchBin "libGLESv2.dll" "$anArchIter" "$aPath/bin"]
+ if { "$aDllPath" == "" } {
+ set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
+ set aDllPath [wokdep:SearchBin "libGLESv2.dll" "$anArchIter" "$aPath/bin"]
+ }
+
+ if { "$aDllPath" != "" } {
+ lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
+ } else {
+ lappend anErrBin$anArchIter "Error: 'libGLESv2.dll' not found (OpenGL ES 2.0)"
+ if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
+ }
+ }
+ }
+ }
+
+ return "$isFound"
+}
+
# Auxiliary function, gets VTK version to set default search directory
proc wokdep:VtkVersion { thePath } {
set aResult "6.1"
puts $aFile "set HAVE_FREEIMAGE=$::HAVE_FREEIMAGE"
puts $aFile "set HAVE_GL2PS=$::HAVE_GL2PS"
puts $aFile "set HAVE_TBB=$::HAVE_TBB"
+ puts $aFile "set HAVE_GLES2=$::HAVE_GLES2"
puts $aFile "set HAVE_D3D=$::HAVE_D3D"
puts $aFile "set HAVE_OPENCL=$::HAVE_OPENCL"
puts $aFile "set HAVE_VTK=$::HAVE_VTK"
puts $aFile "export HAVE_FREEIMAGE=$::HAVE_FREEIMAGE"
puts $aFile "export HAVE_GL2PS=$::HAVE_GL2PS"
puts $aFile "export HAVE_TBB=$::HAVE_TBB"
+ puts $aFile "export HAVE_GLES2=$::HAVE_GLES2"
puts $aFile "export HAVE_OPENCL=$::HAVE_OPENCL"
puts $aFile "export HAVE_VTK=$::HAVE_VTK"
if { "$::tcl_platform(os)" == "Darwin" } {
set aLibsMap(CSF_netapi32) "netapi32"
set aLibsMap(CSF_AviLibs) "ws2_32 vfw32"
set aLibsMap(CSF_OpenGlLibs) "opengl32"
+ if { "$::HAVE_GLES2" == "true" } {
+ set aLibsMap(CSF_OpenGlLibs) "libEGL libGLESv2"
+ }
set aLibsMap(CSF_winspool) "Winspool"
set aLibsMap(CSF_psapi) "Psapi"
set aLibsMap(CSF_d3d9) "d3d9"
set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi"
set aLibsMap(CSF_MotifLibs) "X11"
}
+
+ if { "$::HAVE_GLES2" == "true" } {
+ set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
+ }
}
}
}
set (OpenCASCADE_WITH_GL2PS @USE_GL2PS@)
set (OpenCASCADE_WITH_TBB @USE_TBB@)
set (OpenCASCADE_WITH_VTK @USE_VTK@)
+set (OpenCASCADE_WITH_GLES2 @USE_GLES2@)
@SET_OpenCASCADE_WITH_D3D@
@SET_OpenCASCADE_WITH_GLX@
set "TK_DIR=@3RDPARTY_TK_DLL_DIR@"
set "FREETYPE_DIR=@3RDPARTY_FREETYPE_DLL_DIR@"
set "FREEIMAGE_DIR=@3RDPARTY_FREEIMAGE_DLL_DIR@"
+ set "EGL_DIR=@3RDPARTY_EGL_DLL_DIR@"
+ set "GLES2_DIR=@3RDPARTY_GLES2_DLL_DIR@"
set "GL2PS_DIR=@3RDPARTY_GL2PS_DLL_DIR@"
set "TBB_DIR=@3RDPARTY_TBB_DLL_DIR@"
set "VTK_DIR=@3RDPARTY_VTK_DLL_DIR@"
set "TK_DIR=@USED_3RDPARTY_TK_DIR@"
set "FREETYPE_DIR=@USED_3RDPARTY_FREETYPE_DIR@"
set "FREEIMAGE_DIR=@USED_3RDPARTY_FREEIMAGE_DIR@"
+ set "EGL_DIR=@USED_3RDPARTY_EGL_DIR@"
+ set "GLES2_DIR=@USED_3RDPARTY_GLES2_DIR@"
set "GL2PS_DIR=@USED_3RDPARTY_GL2PS_DIR@"
set "TBB_DIR=@USED_3RDPARTY_TBB_DIR@"
set "VTK_DIR=@USED_3RDPARTY_VTK_DIR@"
set "HAVE_FREEIMAGE=false"
set "HAVE_GL2PS=false"
set "HAVE_VTK=false"
+set "HAVE_GLES2=false"
set "HAVE_D3D=false"
set "CSF_OPT_INC="
set "CSF_OPT_LIB32="
if ["%HAVE_GL2PS%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GL2PS"
if ["%HAVE_FREEIMAGE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE"
if ["%HAVE_VTK%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_VTK"
+if ["%HAVE_GLES2%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GLES2"
if ["%HAVE_D3D%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_D3D"
if ["%HAVE_TBB%"] == ["true"] set "CSF_DEFINES=HAVE_TBB;%CSF_DEFINES%"
if ["%HAVE_OPENCL%"] == ["true"] set "CSF_DEFINES=HAVE_OPENCL;%CSF_DEFINES%"
if ["%HAVE_GL2PS%"] == ["true"] set "CSF_DEFINES=HAVE_GL2PS;%CSF_DEFINES%"
if ["%HAVE_FREEIMAGE%"] == ["true"] set "CSF_DEFINES=HAVE_FREEIMAGE;%CSF_DEFINES%"
if ["%HAVE_VTK%"] == ["true"] set "CSF_DEFINES=HAVE_VTK;%CSF_DEFINES%"
+if ["%HAVE_GLES2%"] == ["true"] set "CSF_DEFINES=HAVE_GLES2;%CSF_DEFINES%"
if ["%HAVE_D3D%"] == ["true"] set "CSF_DEFINES=HAVE_D3D;%CSF_DEFINES%"
rem Eliminate VS warning
if not ["%TK_DIR%"] == [""] set "PATH=%TK_DIR%;%PATH%"
if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%"
if not ["%FREEIMAGE_DIR%"] == [""] set "PATH=%FREEIMAGE_DIR%;%PATH%"
+if not ["%EGL_DIR%"] == [""] set "PATH=%EGL_DIR%;%PATH%"
+if not ["%GLES2_DIR%"] == [""] set "PATH=%GLES2_DIR%;%PATH%"
if not ["%GL2PS_DIR%"] == [""] set "PATH=%GL2PS_DIR%;%PATH%"
if not ["%TBB_DIR%"] == [""] set "PATH=%TBB_DIR%;%PATH%"
if not ["%VTK_DIR%"] == [""] set "PATH=%VTK_DIR%;%PATH%"
export HAVE_FREEIMAGE="false";
export HAVE_GL2PS="false";
export HAVE_VTK="false";
+export HAVE_GLES2="false";
export MACOSX_USE_GLX="false";
export CSF_OPT_INC=""
export CSF_OPT_LIB32=""
if [ "$HAVE_GL2PS" == "true" ]; then
export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GL2PS"
fi
+if [ "$HAVE_GLES2" == "true" ]; then
+ export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GLES2"
+fi
if [ "$HAVE_VTK" == "true" ]; then
export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"
fi
--- /dev/null
+// Copyright (c) 2016 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <Aspect_NeutralWindow.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(Aspect_NeutralWindow, Aspect_Window)
+
+// =======================================================================
+// function : Aspect_NeutralWindow
+// purpose :
+// =======================================================================
+Aspect_NeutralWindow::Aspect_NeutralWindow()
+: myHandle (0),
+ myParentHandle (0),
+ myFBConfig (0),
+ myPosX (0),
+ myPosY (0),
+ myWidth (0),
+ myHeight (0),
+ myIsMapped (Standard_True) {}
+
+// =======================================================================
+// function : SetNativeHandles
+// purpose :
+// =======================================================================
+Standard_Boolean Aspect_NeutralWindow::SetNativeHandles (Aspect_Drawable theWindow,
+ Aspect_Drawable theParentWindow,
+ Aspect_FBConfig theFbConfig)
+{
+ if (myHandle == theWindow
+ && myParentHandle == theParentWindow
+ && myFBConfig == theFbConfig)
+ {
+ return Standard_False;
+ }
+
+ myHandle = theWindow;
+ myParentHandle = theParentWindow;
+ myFBConfig = theFbConfig;
+ return Standard_True;
+}
+
+// =======================================================================
+// function : SetPosition
+// purpose :
+// =======================================================================
+Standard_Boolean Aspect_NeutralWindow::SetPosition (Standard_Integer theX1,
+ Standard_Integer theY1)
+{
+ if (myPosX == theX1
+ && myPosY == theY1)
+ {
+ return Standard_False;
+ }
+
+ myPosX = theX1;
+ myPosY = theY1;
+ return Standard_True;
+}
+
+// =======================================================================
+// function : SetPosition
+// purpose :
+// =======================================================================
+Standard_Boolean Aspect_NeutralWindow::SetPosition (Standard_Integer theX1, Standard_Integer theY1,
+ Standard_Integer theX2, Standard_Integer theY2)
+{
+ Standard_Integer aWidthNew = theX2 - theX1;
+ Standard_Integer aHeightNew = theY2 - theY1;
+ if (myPosX == theX1
+ && myPosY == theY1
+ && myWidth == aWidthNew
+ && myHeight == aHeightNew)
+ {
+ return Standard_False;
+ }
+
+ myPosX = theX1;
+ myWidth = aWidthNew;
+ myPosY = theY1;
+ myHeight = aHeightNew;
+ return Standard_True;
+}
+
+// =======================================================================
+// function : SetSize
+// purpose :
+// =======================================================================
+Standard_Boolean Aspect_NeutralWindow::SetSize (const Standard_Integer theWidth,
+ const Standard_Integer theHeight)
+{
+ if (myWidth == theWidth
+ && myHeight == theHeight)
+ {
+ return Standard_False;
+ }
+
+ myWidth = theWidth;
+ myHeight = theHeight;
+ return Standard_True;
+}
--- /dev/null
+// Copyright (c) 2016 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _Aspect_NeutralWindow_HeaderFile
+#define _Aspect_NeutralWindow_HeaderFile
+
+#include <Aspect_Window.hxx>
+
+//! Defines a platform-neutral window.
+//! This class is intended to be used in context when window management (including OpenGL context creation)
+//! is performed on application side (e.g. using external framework).
+//!
+//! Window properties should be managed by application and assigned to this class as properties.
+class Aspect_NeutralWindow : public Aspect_Window
+{
+ DEFINE_STANDARD_RTTIEXT(Aspect_NeutralWindow, Aspect_Window)
+public:
+
+ //! Empty constructor.
+ //! Note that window is considered "mapped" by default.
+ Standard_EXPORT Aspect_NeutralWindow();
+
+ //! Return native handle of this drawable.
+ virtual Aspect_Drawable NativeHandle() const Standard_OVERRIDE { return myHandle; }
+
+ //! Return native handle of the parent drawable.
+ virtual Aspect_Drawable NativeParentHandle() const Standard_OVERRIDE { return myParentHandle; }
+
+ //! Return FBConfig.
+ virtual Aspect_FBConfig NativeFBConfig() const Standard_OVERRIDE { return myFBConfig; }
+
+ //! Set native handle.
+ //! @return true if definition has been changed
+ Standard_EXPORT Standard_Boolean SetNativeHandle (Aspect_Drawable theWindow) { return SetNativeHandles (theWindow, 0, 0); }
+
+ //! Set native handles.
+ //! @return true if definition has been changed
+ Standard_EXPORT Standard_Boolean SetNativeHandles (Aspect_Drawable theWindow,
+ Aspect_Drawable theParentWindow,
+ Aspect_FBConfig theFbConfig);
+
+ //! Return true if window is not hidden.
+ virtual Standard_Boolean IsMapped() const Standard_OVERRIDE { return myIsMapped; }
+
+ //! Change window mapped flag to TRUE.
+ virtual void Map() const Standard_OVERRIDE { myIsMapped = Standard_True; }
+
+ //! Change window mapped flag to FALSE.
+ virtual void Unmap() const Standard_OVERRIDE { myIsMapped = Standard_False; }
+
+ //! Resize window - do nothing.
+ virtual Aspect_TypeOfResize DoResize() const Standard_OVERRIDE { return Aspect_TOR_UNKNOWN; }
+
+ //! Map window - do nothing.
+ virtual Standard_Boolean DoMapping() const Standard_OVERRIDE { return Standard_True; }
+
+ //! Returns window ratio equal to the physical width/height dimensions.
+ virtual Quantity_Ratio Ratio() const Standard_OVERRIDE
+ {
+ return (myWidth != 0 && myHeight != 0)
+ ? Quantity_Ratio(myWidth) / Quantity_Ratio(myHeight)
+ : 1.0;
+ }
+
+ //! Return the window position.
+ virtual void Position (Standard_Integer& theX1, Standard_Integer& theY1,
+ Standard_Integer& theX2, Standard_Integer& theY2) const Standard_OVERRIDE
+ {
+ theX1 = myPosX;
+ theX2 = myPosX + myWidth;
+ theY1 = myPosY;
+ theY2 = myPosY + myHeight;
+ }
+
+ //! Set the window position.
+ //! @return true if position has been changed
+ Standard_EXPORT Standard_Boolean SetPosition (Standard_Integer theX1,
+ Standard_Integer theY1);
+
+ //! Set the window position.
+ //! @return true if position has been changed
+ Standard_EXPORT Standard_Boolean SetPosition (Standard_Integer theX1, Standard_Integer theY1,
+ Standard_Integer theX2, Standard_Integer theY2);
+
+ //! Return the window size.
+ virtual void Size (Standard_Integer& theWidth,
+ Standard_Integer& theHeight) const Standard_OVERRIDE
+ {
+ theWidth = myWidth;
+ theHeight = myHeight;
+ }
+
+ //! Set the window size.
+ //! @return true if size has been changed
+ Standard_EXPORT Standard_Boolean SetSize (const Standard_Integer theWidth,
+ const Standard_Integer theHeight);
+
+protected:
+
+ Aspect_Drawable myHandle;
+ Aspect_Drawable myParentHandle;
+ Aspect_FBConfig myFBConfig;
+ Standard_Integer myPosX;
+ Standard_Integer myPosY;
+ Standard_Integer myWidth;
+ Standard_Integer myHeight;
+ mutable Standard_Boolean myIsMapped;
+
+};
+
+DEFINE_STANDARD_HANDLE(Aspect_NeutralWindow, Aspect_Window)
+
+#endif // _Aspect_NeutralWindow_HeaderFile
Aspect_Grid.hxx
Aspect_GridDrawMode.hxx
Aspect_GridType.hxx
+Aspect_NeutralWindow.cxx
+Aspect_NeutralWindow.hxx
Aspect_Handle.hxx
Aspect_HatchStyle.hxx
Aspect_IdentDefinitionError.hxx
myListOfFonts.Clear();
Handle(Font_FTLibrary) aFtLibrary;
-#if defined(_WIN32)
+#if defined(OCCT_UWP)
+ // system font files are not accessible
+ (void )aFtLibrary;
+#elif defined(_WIN32)
// font directory is placed in "C:\Windows\Fonts\"
UINT aStrLength = GetSystemWindowsDirectoryA (NULL, 0);
#include <windows.h>
+#include <NCollection_DataMap.hxx>
#include <NCollection_UtfString.hxx>
+#include <Standard_Mutex.hxx>
#if defined(_MSC_VER)
#pragma warning( disable : 4700 )
#endif
-#ifndef OCCT_UWP
+#ifdef OCCT_UWP
+namespace
+{
+ // emulate global map of environment variables
+ static Standard_Mutex THE_ENV_LOCK;
+ static NCollection_DataMap<TCollection_AsciiString, TCollection_AsciiString> THE_ENV_MAP;
+}
+#else
static void __fastcall _set_error ( OSD_Error&, DWORD );
#endif
TCollection_AsciiString OSD_Environment::Value()
{
-#ifndef OCCT_UWP
myValue.Clear();
-
+#ifdef OCCT_UWP
+ Standard_Mutex::Sentry aLock (THE_ENV_LOCK);
+ THE_ENV_MAP.Find (myName, myValue);
+#else
SetLastError (ERROR_SUCCESS);
wchar_t* anEnvVal = NULL;
NCollection_UtfWideString aNameWide (myName.ToCString());
Reset();
}
myValue = aValue.ToCString();
- return myValue;
-#else
- myValue = "";
- return myValue;
#endif
+ return myValue;
}
void OSD_Environment :: SetName ( const TCollection_AsciiString& name ) {
void OSD_Environment::Build()
{
-#ifndef OCCT_UWP
+#ifdef OCCT_UWP
+ Standard_Mutex::Sentry aLock(THE_ENV_LOCK);
+ THE_ENV_MAP.Bind (myName, myValue);
+#else
NCollection_Utf8String aSetVariable = NCollection_Utf8String(myName.ToCString()) + "=" + myValue.ToCString();
_wputenv (aSetVariable.ToUtfWide().ToCString());
#endif
void OSD_Environment::Remove()
{
-#ifndef OCCT_UWP
+#ifdef OCCT_UWP
+ Standard_Mutex::Sentry aLock(THE_ENV_LOCK);
+ THE_ENV_MAP.UnBind (myName);
+#else
NCollection_Utf8String aSetVariable = NCollection_Utf8String(myName.ToCString()) + "=";
_wputenv (aSetVariable.ToUtfWide().ToCString());
#endif
{
#if !defined(__CYGWIN32__) && !defined(__MINGW32__)
Standard_Mutex::Sentry aSentry (THE_SIGNAL_MUTEX); // lock the mutex to prevent simultaneous handling
+#if !defined(OCCT_UWP) || defined(NTDDI_WIN10_TH2)
LPTOP_LEVEL_EXCEPTION_FILTER aPreviousFilter;
OSD_Environment env ("CSF_DEBUG_MODE");
// Replaces the existing top-level exception filter for all existing and all future threads
// in the calling process
aPreviousFilter = ::SetUnhandledExceptionFilter (/*(LPTOP_LEVEL_EXCEPTION_FILTER)*/ WntHandler);
+#endif // NTDDI_WIN10_TH2
// Signal handlers will only be used when the method ::raise() will be used
// Handlers must be set for every thread
#ifndef __OPENGL_AVIWRITER_H
#define __OPENGL_AVIWRITER_H
-#ifdef _MSC_VER
+#if defined(_WIN32)
+ #include <windows.h>
+#endif
+
+#include <Standard_Macro.hxx>
-#define THIS void
-#include <windows.h>
+#if defined(_MSC_VER) && !defined(OCCT_UWP)
#include <stdlib.h>
#include <vfw.h>
arbDbg (NULL),
arbFBO (NULL),
arbFBOBlit (NULL),
+ extFragDepth (Standard_False),
extGS (NULL),
extBgra(Standard_False),
extAnis(Standard_False),
{
arbFBOBlit = (OpenGl_ArbFBOBlit* )(&(*myFuncs));
}
+ extFragDepth = !IsGlGreaterEqual(3, 0)
+ && CheckExtension ("GL_EXT_frag_depth");
if (IsGlGreaterEqual (3, 1)
&& FindProc ("glTexStorage2DMultisample", myFuncs->glTexStorage2DMultisample))
{
OpenGl_ArbDbg* arbDbg; //!< GL_ARB_debug_output
OpenGl_ArbFBO* arbFBO; //!< GL_ARB_framebuffer_object
OpenGl_ArbFBOBlit* arbFBOBlit; //!< glBlitFramebuffer function, moved out from OpenGl_ArbFBO structure for compatibility with OpenGL ES 2.0
+ Standard_Boolean extFragDepth; //!< GL_EXT_frag_depth on OpenGL ES 2.0 (gl_FragDepthEXT built-in variable, before OpenGL ES 3.0)
OpenGl_ExtGS* extGS; //!< GL_EXT_geometry_shader4
Standard_Boolean extBgra; //!< GL_EXT_bgra or GL_EXT_texture_format_BGRA8888 on OpenGL ES
Standard_Boolean extAnis; //!< GL_EXT_texture_filter_anisotropic
#include <windows.h>
#endif
+#include <Standard_Macro.hxx>
+#include <Standard_TypeDef.hxx>
+
#ifndef APIENTRY
#define APIENTRY
#endif
#include <OpenGL/gl.h>
#endif
#define __X_GL_H // prevent chaotic gl.h inclusions to avoid compile errors
-#elif defined(HAVE_GLES2) || defined(__ANDROID__) || defined(__QNX__)
+#elif defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__)
+ #if defined(_WIN32)
+ // Angle OpenGL ES headers do not define function prototypes even for core functions,
+ // however OCCT is expected to be linked against libGLESv2
+ #define GL_GLEXT_PROTOTYPES
+ #endif
#include <GLES2/gl2.h>
//#include <GLES3/gl3.h>
#else
#define GL_DEBUG_SEVERITY_LOW 0x9148
#endif
-#if defined(__ANDROID__) || defined(__QNX__)
+#if !defined(HAVE_EGL) && (defined(__ANDROID__) || defined(__QNX__) || defined(HAVE_GLES2) || defined(OCCT_UWP))
#define HAVE_EGL
#endif
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
+#if defined(_WIN32)
+ #include <windows.h>
+#endif
+
#include <OpenGl_GraphicDriver.hxx>
#include <OpenGl_Context.hxx>
#include <OpenGl_Flipper.hxx>
#include <X11/Xlib.h> // XOpenDisplay()
#endif
-#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
+#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__)
#include <EGL/egl.h>
#endif
const Standard_Boolean theToInitialize)
: Graphic3d_GraphicDriver (theDisp),
myIsOwnContext (Standard_False),
-#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
+#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__)
myEglDisplay ((Aspect_Display )EGL_NO_DISPLAY),
myEglContext ((Aspect_RenderingContext )EGL_NO_CONTEXT),
myEglConfig (NULL),
|| ::getenv ("CALL_SYNCHRO_X") != NULL;
XSynchronize (aDisplay, toSync);
-#if !defined(HAVE_EGL)
+#if !defined(HAVE_EGL) && !defined(HAVE_GLES2)
// does the server know about OpenGL & GLX?
int aDummy;
if (!XQueryExtension (aDisplay, "GLX", &aDummy, &aDummy, &aDummy))
aWindow->GetGlContext()->forcedRelease();
}
-#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
+#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__)
if (myIsOwnContext)
{
if (myEglContext != (Aspect_RenderingContext )EGL_NO_CONTEXT)
Standard_Boolean OpenGl_GraphicDriver::InitContext()
{
ReleaseContext();
-#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
+#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__)
#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
if (myDisplayConnection.IsNull())
::Message::DefaultMessenger()->Send ("Error: EGL is unable to create OpenGL context!", Message_Fail);
return Standard_False;
}
- if (eglMakeCurrent ((EGLDisplay )myEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, (EGLContext )myEglContext) != EGL_TRUE)
- {
- ::Message::DefaultMessenger()->Send ("Error: EGL is unable bind OpenGL context!", Message_Fail);
- return Standard_False;
- }
+ // eglMakeCurrent() fails or even crash with EGL_NO_SURFACE on some implementations
+ //if (eglMakeCurrent ((EGLDisplay )myEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, (EGLContext )myEglContext) != EGL_TRUE)
+ //{
+ // ::Message::DefaultMessenger()->Send ("Error: EGL is unable bind OpenGL context!", Message_Fail);
+ // return Standard_False;
+ //}
#endif
myIsOwnContext = Standard_True;
return Standard_True;
}
-#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
+#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__)
// =======================================================================
// function : InitEglContext
// purpose :
// Parse the list of views to find
// a view with the specified window
-#if defined(_WIN32)
+#if defined(_WIN32) && !defined(OCCT_UWP)
const Handle(WNT_Window) THEWindow = Handle(WNT_Window)::DownCast (AWindow);
Aspect_Handle TheSpecifiedWindowId = THEWindow->HWindow ();
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
#else
NSView* TheSpecifiedWindowId = THEWindow->HView();
#endif
-#elif defined(__ANDROID__) || defined(__QNX__)
+#elif defined(__ANDROID__) || defined(__QNX__) || defined(OCCT_UWP)
(void )AWindow;
int TheSpecifiedWindowId = -1;
#else
{
const Handle(Aspect_Window) AspectWindow = aView->Window();
-#if defined(_WIN32)
+#if defined(_WIN32) && !defined(OCCT_UWP)
const Handle(WNT_Window) theWindow = Handle(WNT_Window)::DownCast (AspectWindow);
Aspect_Handle TheWindowIdOfView = theWindow->HWindow ();
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
#else
NSView* TheWindowIdOfView = theWindow->HView();
#endif
-#elif defined(__ANDROID__) || defined(__QNX__)
+#elif defined(__ANDROID__) || defined(__QNX__) || defined(OCCT_UWP)
int TheWindowIdOfView = 0;
#else
const Handle(Xw_Window) theWindow = Handle(Xw_Window)::DownCast (AspectWindow);
//! Perform initialization of default OpenGL context.
Standard_EXPORT Standard_Boolean InitContext();
-#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
+#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__)
//! Initialize default OpenGL context using existing one.
//! @param theEglDisplay EGL connection to the Display
//! @param theEglContext EGL rendering context
//! Could return NULL-handle if no window created by this driver.
Standard_EXPORT const Handle(OpenGl_Context)& GetSharedContext() const;
-#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
+#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__)
Aspect_Display getRawGlDisplay() const { return myEglDisplay; }
Aspect_RenderingContext getRawGlContext() const { return myEglContext; }
void* getRawGlConfig() const { return myEglConfig; }
protected:
Standard_Boolean myIsOwnContext; //!< indicates that shared context has been created within OpenGl_GraphicDriver
-#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
+#if defined(HAVE_EGL) || defined(HAVE_GLES2) || defined(OCCT_UWP) || defined(__ANDROID__) || defined(__QNX__)
Aspect_Display myEglDisplay; //!< EGL connection to the Display : EGLDisplay
Aspect_RenderingContext myEglContext; //!< EGL rendering context : EGLContext
void* myEglConfig; //!< EGL configuration : EGLConfig
{
aProgramSrc->SetHeader ("#version 300 es");
}
+ else if (myContext->extFragDepth)
+ {
+ aProgramSrc->SetHeader ("#extension GL_EXT_frag_depth : enable"
+ EOL"#define gl_FragDepth gl_FragDepthEXT");
+ }
else
{
// there is no way to draw into depth buffer
aCtx->core20fwd->glDepthFunc (GL_ALWAYS);
aCtx->core20fwd->glDepthMask (GL_TRUE);
aCtx->core20fwd->glEnable (GL_DEPTH_TEST);
+ #if defined(GL_ES_VERSION_2_0)
+ if (!aCtx->IsGlGreaterEqual (3, 0)
+ && !aCtx->extFragDepth)
+ {
+ aCtx->core20fwd->glDisable (GL_DEPTH_TEST);
+ }
+ #endif
myWorkspace->DisableTexture();
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Window,MMgt_TShared)
-#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
+#if defined(HAVE_EGL)
#include <EGL/egl.h>
#endif
namespace
{
-#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
+#if defined(HAVE_EGL)
//
#elif defined(_WIN32)
Standard_Boolean isCoreProfile = Standard_False;
-#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
+#if defined(HAVE_EGL)
EGLDisplay anEglDisplay = (EGLDisplay )theDriver->getRawGlDisplay();
EGLContext anEglContext = (EGLContext )theDriver->getRawGlContext();
EGLConfig anEglConfig = (EGLConfig )theDriver->getRawGlConfig();
// release "GL" context if it is owned by window
// Mesa implementation can fail to destroy GL context if it set for current thread.
// It should be safer to unset thread GL context before its destruction.
-#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
+#if defined(HAVE_EGL)
if ((EGLSurface )myGlContext->myWindow != EGL_NO_SURFACE)
{
eglDestroySurface ((EGLDisplay )myGlContext->myDisplay,
// =======================================================================
void OpenGl_Window::Resize()
{
-#if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__) && !defined(__QNX__)
+#if !defined(_WIN32) && !defined(HAVE_EGL)
Display* aDisp = (Display* )myGlContext->myDisplay;
if (aDisp == NULL)
return;
myWidth = aWidth;
myHeight = aHeight;
-#if !defined(_WIN32) && !defined(HAVE_EGL) && !defined(__ANDROID__) && !defined(__QNX__)
+#if !defined(_WIN32) && !defined(HAVE_EGL)
XResizeWindow (aDisp, myGlContext->myWindow, (unsigned int )myWidth, (unsigned int )myHeight);
XSync (aDisp, False);
#endif
if (!Activate())
return;
-#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
+#if defined(HAVE_EGL)
eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_WIDTH, &myWidth);
eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_HEIGHT, &myHeight);
#elif defined(_WIN32)
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-// On Windows, function TryEnterCriticalSection has appeared in Windows NT
-// and is surrounded by #ifdef in MS VC++ 7.1 headers.
-// Thus to use it we need to define appropriate macro saying that we wil
-// run on Windows NT 4.0 at least
-#if ((defined(_WIN32) || defined(__WIN32__)) && !defined(_WIN32_WINNT))
- #define _WIN32_WINNT 0x0400
-#endif
-
#include <Standard_Mutex.hxx>
#include <Standard_OStream.hxx>
aTA->Aspect()->Font();
OpenGl_Vec4 aColor = theWorkspace->LineColor();
+#if !defined(GL_ES_VERSION_2_0)
// Finally draw something to make sure UserDraw really works
glPushAttrib(GL_ENABLE_BIT);
glDisable(GL_LIGHTING);
glVertex3f(myCoords[0], myCoords[1], myCoords[5]);
glEnd();
glPopAttrib();
+#endif
}
} // end of anonymous namespace
Standard_Integer /*theArgNb*/,
const char** /*theArgVec*/)
{
+#if !defined(GL_ES_VERSION_2_0)
// get the active view
Handle(V3d_View) aView = ViewerTest::CurrentView();
if (aView.IsNull())
<< "Buffer size GL_3D_COLOR: " << aLen3D_rgba * double(sizeof(GLfloat)) / double(1024 * 1024) << " MiB\n";
return 0;
}
+#else
+ (void )theDI;
+ std::cout << "Command is unsupported on current platform.\n";
+ return 1;
+#endif
}
//==============================================================================
#include <windows.h>
+#include <WNT_WClass.hxx>
+
#include <Standard_PCharacter.hxx>
#include <Standard_Type.hxx>
#include <WNT_ClassDefinitionError.hxx>
-#include <WNT_WClass.hxx>
#include <WNT_Window.hxx>
+#if defined(_WIN32) && !defined(OCCT_UWP)
+
#include <string.h>
IMPLEMENT_STANDARD_RTTIEXT(WNT_WClass,MMgt_TShared)
} // end WNT_WClass :: Destroy
+#endif // _WIN32
#define _WNT_WClass_HeaderFile
#include <Standard.hxx>
-#include <Standard_Type.hxx>
+#if defined(_WIN32) && !defined(OCCT_UWP)
+
+#include <Standard_Type.hxx>
#include <Standard_CString.hxx>
#include <Aspect_Handle.hxx>
#include <Standard_Address.hxx>
protected:
-
Standard_CString lpszName;
Aspect_Handle hInstance;
Standard_Address lpfnWndProc;
-
-private:
-
-
-
-
};
-
#include <WNT_WClass.lxx>
-
-
-
-
+#endif // _WIN32
#endif // _WNT_WClass_HeaderFile
// include windows.h first to have all definitions available
#include <windows.h>
+#include <WNT_Window.hxx>
+
+#if defined(_WIN32) && !defined(OCCT_UWP)
#include <Aspect_Convert.hxx>
#include <Aspect_WindowDefinitionError.hxx>
#include <Image_AlienPixMap.hxx>
#include <Standard_Type.hxx>
#include <WNT_WClass.hxx>
-#include <WNT_Window.hxx>
#include <stdio.h>
aXRight = theX1;
aYBottom = theY1;
}
+
+#endif // _WIN32
#define _WNT_Window_HeaderFile
#include <Standard.hxx>
-#include <Standard_Type.hxx>
+#if defined(_WIN32) && !defined(OCCT_UWP)
+
+#include <Standard_Type.hxx>
#include <Standard_Integer.hxx>
#include <Aspect_Handle.hxx>
#include <Standard_Boolean.hxx>
protected:
-
Standard_Integer aXLeft;
Standard_Integer aYTop;
Standard_Integer aXRight;
Aspect_Handle myHParentWindow;
Standard_Boolean myIsForeign;
-
-private:
-
-
-
-
};
-
#include <WNT_Window.lxx>
-
-
-
-
+#endif // _WIN32
#endif // _WNT_Window_HeaderFile