mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0027811: Configuration - allow building TKOpenGl with OpenGL ES on Windows
OpenGl_ShaderManager::prepareStdProgramFboBlit() now tries using extension GL_EXT_frag_depth within OpenGL ES 2.0 when OpenGL ES 3.0 is not available. OpenGl_View::blitBuffers() now disables Depth test when copying depth values is not supported by OpenGL ES 2.0 hardware. Fixed building for UWP with SDK 10.0.10240.0 Fixed building TKService, TKV3d and TKOpenGl for UWP. OSD_Environment now defines global environment map for emulating desktop behavior on UWP.
This commit is contained in:
parent
21a2b7ccf4
commit
1ce0716bb1
@ -501,6 +501,34 @@ else()
|
|||||||
OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
|
OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE")
|
||||||
endif()
|
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
|
# GL2PS
|
||||||
# search for CSF_GL2PS variable in EXTERNLIB of each being used toolkit
|
# search for CSF_GL2PS variable in EXTERNLIB of each being used toolkit
|
||||||
OCCT_IS_PRODUCT_REQUIRED (CSF_GL2PS CAN_USE_GL2PS)
|
OCCT_IS_PRODUCT_REQUIRED (CSF_GL2PS CAN_USE_GL2PS)
|
||||||
|
6
adm/cmake/egl.cmake
Normal file
6
adm/cmake/egl.cmake
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# EGL
|
||||||
|
if (WIN32)
|
||||||
|
THIRDPARTY_PRODUCT("EGL" "EGL/egl.h" "libEGL" "libEGL")
|
||||||
|
else()
|
||||||
|
THIRDPARTY_PRODUCT("EGL" "EGL/egl.h" "EGL" "EGL")
|
||||||
|
endif()
|
6
adm/cmake/gles2.cmake
Normal file
6
adm/cmake/gles2.cmake
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# OpenGL ES 2.0
|
||||||
|
if (WIN32)
|
||||||
|
THIRDPARTY_PRODUCT("GLES2" "GLES2/gl2.h" "libGLESv2" "libGLESv2")
|
||||||
|
else()
|
||||||
|
THIRDPARTY_PRODUCT("GLES2" "GLES2/gl2.h" "GLESv2" "GLESv2")
|
||||||
|
endif()
|
@ -36,7 +36,11 @@ if (WIN32)
|
|||||||
set (CSF_winspool "Winspool.lib")
|
set (CSF_winspool "Winspool.lib")
|
||||||
set (CSF_psapi "Psapi.lib")
|
set (CSF_psapi "Psapi.lib")
|
||||||
set (CSF_AviLibs "ws2_32.lib vfw32.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)
|
if (USE_FREETYPE)
|
||||||
set (CSF_FREETYPE "freetype.lib")
|
set (CSF_FREETYPE "freetype.lib")
|
||||||
|
@ -80,7 +80,7 @@ if (BUILD_SHARED_LIBS)
|
|||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
if (NOT 3RDPARTY_TCL_DLL)
|
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 "")
|
set (DLL_FOLDER_FOR_SEARCH "")
|
||||||
if (3RDPARTY_TCL_DLL_DIR)
|
if (3RDPARTY_TCL_DLL_DIR)
|
||||||
@ -147,7 +147,7 @@ if (BUILD_SHARED_LIBS)
|
|||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
if (NOT 3RDPARTY_TCL_DLL)
|
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 "")
|
set (DLL_FOLDER_FOR_SEARCH "")
|
||||||
if (3RDPARTY_TCL_DLL_DIR)
|
if (3RDPARTY_TCL_DLL_DIR)
|
||||||
|
@ -84,7 +84,7 @@ if (BUILD_SHARED_LIBS)
|
|||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
if (NOT 3RDPARTY_TK_DLL)
|
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 "")
|
set (DLL_FOLDER_FOR_SEARCH "")
|
||||||
if (3RDPARTY_TK_DLL_DIR)
|
if (3RDPARTY_TK_DLL_DIR)
|
||||||
@ -151,7 +151,7 @@ if (BUILD_SHARED_LIBS)
|
|||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
if (NOT 3RDPARTY_TK_DLL)
|
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 "")
|
set (DLL_FOLDER_FOR_SEARCH "")
|
||||||
if (3RDPARTY_TK_DLL_DIR)
|
if (3RDPARTY_TK_DLL_DIR)
|
||||||
|
@ -72,6 +72,8 @@ INSTALL_MESSAGE (INSTALL_SAMPLES "OCCT samples")
|
|||||||
INSTALL_MESSAGE (INSTALL_TEST_CASES "non-regression OCCT test scripts")
|
INSTALL_MESSAGE (INSTALL_TEST_CASES "non-regression OCCT test scripts")
|
||||||
INSTALL_MESSAGE (INSTALL_DOC_Overview "OCCT overview documentation (HTML format)")
|
INSTALL_MESSAGE (INSTALL_DOC_Overview "OCCT overview documentation (HTML format)")
|
||||||
INSTALL_MESSAGE (INSTALL_FREEIMAGE "FreeImage binaries")
|
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_FREETYPE "FreeType binaries")
|
||||||
INSTALL_MESSAGE (INSTALL_GL2PS "GL2PS binaries")
|
INSTALL_MESSAGE (INSTALL_GL2PS "GL2PS binaries")
|
||||||
INSTALL_MESSAGE (INSTALL_TBB "TBB binaries")
|
INSTALL_MESSAGE (INSTALL_TBB "TBB binaries")
|
||||||
@ -127,6 +129,14 @@ set (USE_FREEIMAGE_DESCR
|
|||||||
"Indicates whether Freeimage product should be used in OCCT visualization
|
"Indicates whether Freeimage product should be used in OCCT visualization
|
||||||
module for support of popular graphics image formats (PNG, BMP etc)")
|
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
|
set (USE_GL2PS_DESCR
|
||||||
"Indicates whether GL2PS product should be used in OCCT visualization
|
"Indicates whether GL2PS product should be used in OCCT visualization
|
||||||
module for support of vector image formats (PS, EPS etc)")
|
module for support of vector image formats (PS, EPS etc)")
|
||||||
@ -148,7 +158,7 @@ set (USE_D3D_DESCR "Indicates whether optional Direct3D wrapper in OCCT visualiz
|
|||||||
|
|
||||||
macro (BUILD_MODULE MODULE_NAME)
|
macro (BUILD_MODULE MODULE_NAME)
|
||||||
set (ENABLE_MODULE TRUE)
|
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)
|
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)
|
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" AND CAN_BE_USED_IN_UWP EQUAL -1)
|
||||||
set (ENABLE_MODULE FALSE)
|
set (ENABLE_MODULE FALSE)
|
||||||
|
@ -127,6 +127,16 @@ proc wokdep:gui:UpdateList {} {
|
|||||||
wokdep:SearchTclTk anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
wokdep:SearchTclTk anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
||||||
wokdep:SearchFreeType anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
wokdep:SearchFreeType anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
||||||
wokdep:SearchX11 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" } {
|
if { "$::HAVE_FREEIMAGE" == "true" } {
|
||||||
wokdep:SearchFreeImage anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
wokdep:SearchFreeImage anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs
|
||||||
}
|
}
|
||||||
@ -384,6 +394,10 @@ checkbutton .myFrame.myChecks.myGl2psCheck -offvalue "false" -onvalue "true
|
|||||||
ttk::label .myFrame.myChecks.myGl2psLbl -text "Use GL2PS"
|
ttk::label .myFrame.myChecks.myGl2psLbl -text "Use GL2PS"
|
||||||
checkbutton .myFrame.myChecks.myTbbCheck -offvalue "false" -onvalue "true" -variable HAVE_TBB -command wokdep:gui:UpdateList
|
checkbutton .myFrame.myChecks.myTbbCheck -offvalue "false" -onvalue "true" -variable HAVE_TBB -command wokdep:gui:UpdateList
|
||||||
ttk::label .myFrame.myChecks.myTbbLbl -text "Use Intel TBB"
|
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" } {
|
if { "$::tcl_platform(platform)" == "windows" } {
|
||||||
checkbutton .myFrame.myChecks.myD3dCheck -offvalue "false" -onvalue "true" -variable HAVE_D3D -command wokdep:gui:UpdateList
|
checkbutton .myFrame.myChecks.myD3dCheck -offvalue "false" -onvalue "true" -variable HAVE_D3D -command wokdep:gui:UpdateList
|
||||||
ttk::label .myFrame.myChecks.myD3dLbl -text "Use Direct3D"
|
ttk::label .myFrame.myChecks.myD3dLbl -text "Use Direct3D"
|
||||||
@ -487,10 +501,8 @@ grid .myFrame.myChecks.myTbbCheck -row $aCheckRowIter -column 2 -sticky e
|
|||||||
grid .myFrame.myChecks.myTbbLbl -row $aCheckRowIter -column 3 -sticky w
|
grid .myFrame.myChecks.myTbbLbl -row $aCheckRowIter -column 3 -sticky w
|
||||||
grid .myFrame.myChecks.myQt4Check -row $aCheckRowIter -column 4 -sticky e
|
grid .myFrame.myChecks.myQt4Check -row $aCheckRowIter -column 4 -sticky e
|
||||||
grid .myFrame.myChecks.myQt4Lbl -row $aCheckRowIter -column 5 -sticky w
|
grid .myFrame.myChecks.myQt4Lbl -row $aCheckRowIter -column 5 -sticky w
|
||||||
if { "$::tcl_platform(platform)" == "windows" } {
|
grid .myFrame.myChecks.myGlesCheck -row $aCheckRowIter -column 6 -sticky e
|
||||||
grid .myFrame.myChecks.myD3dCheck -row $aCheckRowIter -column 6 -sticky e
|
grid .myFrame.myChecks.myGlesLbl -row $aCheckRowIter -column 7 -sticky w
|
||||||
grid .myFrame.myChecks.myD3dLbl -row $aCheckRowIter -column 7 -sticky w
|
|
||||||
}
|
|
||||||
#grid .myFrame.myChecks.myOpenClCheck -row $aCheckRowIter -column 6 -sticky e
|
#grid .myFrame.myChecks.myOpenClCheck -row $aCheckRowIter -column 6 -sticky e
|
||||||
#grid .myFrame.myChecks.myOpenClLbl -row $aCheckRowIter -column 7 -sticky w
|
#grid .myFrame.myChecks.myOpenClLbl -row $aCheckRowIter -column 7 -sticky w
|
||||||
incr aCheckRowIter
|
incr aCheckRowIter
|
||||||
@ -500,6 +512,10 @@ grid .myFrame.myChecks.myVtkCheck -row $aCheckRowIter -column 2 -sticky e
|
|||||||
grid .myFrame.myChecks.myVtkLbl -row $aCheckRowIter -column 3 -sticky w
|
grid .myFrame.myChecks.myVtkLbl -row $aCheckRowIter -column 3 -sticky w
|
||||||
grid .myFrame.myChecks.myJDKCheck -row $aCheckRowIter -column 4 -sticky e
|
grid .myFrame.myChecks.myJDKCheck -row $aCheckRowIter -column 4 -sticky e
|
||||||
grid .myFrame.myChecks.myJDKLbl -row $aCheckRowIter -column 5 -sticky w
|
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
|
incr aCheckRowIter
|
||||||
if { "$::tcl_platform(os)" == "Darwin" } {
|
if { "$::tcl_platform(os)" == "Darwin" } {
|
||||||
grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 0 -sticky e
|
grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 0 -sticky e
|
||||||
|
@ -47,6 +47,7 @@ set HAVE_FREEIMAGE "false"
|
|||||||
set HAVE_GL2PS "false"
|
set HAVE_GL2PS "false"
|
||||||
set HAVE_TBB "false"
|
set HAVE_TBB "false"
|
||||||
set HAVE_D3D "false"
|
set HAVE_D3D "false"
|
||||||
|
set HAVE_GLES2 "false"
|
||||||
set HAVE_OPENCL "false"
|
set HAVE_OPENCL "false"
|
||||||
set HAVE_VTK "false"
|
set HAVE_VTK "false"
|
||||||
set MACOSX_USE_GLX "false"
|
set MACOSX_USE_GLX "false"
|
||||||
@ -89,6 +90,9 @@ if { [info exists ::env(HAVE_TBB)] } {
|
|||||||
if { [info exists ::env(HAVE_D3D)] } {
|
if { [info exists ::env(HAVE_D3D)] } {
|
||||||
set HAVE_D3D "$::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)] } {
|
if { [info exists ::env(HAVE_OPENCL)] } {
|
||||||
set HAVE_OPENCL "$::env(HAVE_OPENCL)"
|
set HAVE_OPENCL "$::env(HAVE_OPENCL)"
|
||||||
}
|
}
|
||||||
@ -647,6 +651,148 @@ proc wokdep:SearchOpenCL {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBi
|
|||||||
return "$isFound"
|
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
|
# Auxiliary function, gets VTK version to set default search directory
|
||||||
proc wokdep:VtkVersion { thePath } {
|
proc wokdep:VtkVersion { thePath } {
|
||||||
set aResult "6.1"
|
set aResult "6.1"
|
||||||
@ -932,6 +1078,7 @@ proc wokdep:SaveCustom {} {
|
|||||||
puts $aFile "set HAVE_FREEIMAGE=$::HAVE_FREEIMAGE"
|
puts $aFile "set HAVE_FREEIMAGE=$::HAVE_FREEIMAGE"
|
||||||
puts $aFile "set HAVE_GL2PS=$::HAVE_GL2PS"
|
puts $aFile "set HAVE_GL2PS=$::HAVE_GL2PS"
|
||||||
puts $aFile "set HAVE_TBB=$::HAVE_TBB"
|
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_D3D=$::HAVE_D3D"
|
||||||
puts $aFile "set HAVE_OPENCL=$::HAVE_OPENCL"
|
puts $aFile "set HAVE_OPENCL=$::HAVE_OPENCL"
|
||||||
puts $aFile "set HAVE_VTK=$::HAVE_VTK"
|
puts $aFile "set HAVE_VTK=$::HAVE_VTK"
|
||||||
@ -982,6 +1129,7 @@ proc wokdep:SaveCustom {} {
|
|||||||
puts $aFile "export HAVE_FREEIMAGE=$::HAVE_FREEIMAGE"
|
puts $aFile "export HAVE_FREEIMAGE=$::HAVE_FREEIMAGE"
|
||||||
puts $aFile "export HAVE_GL2PS=$::HAVE_GL2PS"
|
puts $aFile "export HAVE_GL2PS=$::HAVE_GL2PS"
|
||||||
puts $aFile "export HAVE_TBB=$::HAVE_TBB"
|
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_OPENCL=$::HAVE_OPENCL"
|
||||||
puts $aFile "export HAVE_VTK=$::HAVE_VTK"
|
puts $aFile "export HAVE_VTK=$::HAVE_VTK"
|
||||||
if { "$::tcl_platform(os)" == "Darwin" } {
|
if { "$::tcl_platform(os)" == "Darwin" } {
|
||||||
|
@ -1106,6 +1106,9 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
|
|||||||
set aLibsMap(CSF_netapi32) "netapi32"
|
set aLibsMap(CSF_netapi32) "netapi32"
|
||||||
set aLibsMap(CSF_AviLibs) "ws2_32 vfw32"
|
set aLibsMap(CSF_AviLibs) "ws2_32 vfw32"
|
||||||
set aLibsMap(CSF_OpenGlLibs) "opengl32"
|
set aLibsMap(CSF_OpenGlLibs) "opengl32"
|
||||||
|
if { "$::HAVE_GLES2" == "true" } {
|
||||||
|
set aLibsMap(CSF_OpenGlLibs) "libEGL libGLESv2"
|
||||||
|
}
|
||||||
set aLibsMap(CSF_winspool) "Winspool"
|
set aLibsMap(CSF_winspool) "Winspool"
|
||||||
set aLibsMap(CSF_psapi) "Psapi"
|
set aLibsMap(CSF_psapi) "Psapi"
|
||||||
set aLibsMap(CSF_d3d9) "d3d9"
|
set aLibsMap(CSF_d3d9) "d3d9"
|
||||||
@ -1139,6 +1142,10 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } {
|
|||||||
set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi"
|
set aLibsMap(CSF_XwLibs) "X11 Xext Xmu Xi"
|
||||||
set aLibsMap(CSF_MotifLibs) "X11"
|
set aLibsMap(CSF_MotifLibs) "X11"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if { "$::HAVE_GLES2" == "true" } {
|
||||||
|
set aLibsMap(CSF_OpenGlLibs) "EGL GLESv2"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,7 @@ set (OpenCASCADE_WITH_FREEIMAGE @USE_FREEIMAGE@)
|
|||||||
set (OpenCASCADE_WITH_GL2PS @USE_GL2PS@)
|
set (OpenCASCADE_WITH_GL2PS @USE_GL2PS@)
|
||||||
set (OpenCASCADE_WITH_TBB @USE_TBB@)
|
set (OpenCASCADE_WITH_TBB @USE_TBB@)
|
||||||
set (OpenCASCADE_WITH_VTK @USE_VTK@)
|
set (OpenCASCADE_WITH_VTK @USE_VTK@)
|
||||||
|
set (OpenCASCADE_WITH_GLES2 @USE_GLES2@)
|
||||||
@SET_OpenCASCADE_WITH_D3D@
|
@SET_OpenCASCADE_WITH_D3D@
|
||||||
@SET_OpenCASCADE_WITH_GLX@
|
@SET_OpenCASCADE_WITH_GLX@
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@ if /I "%VCVER%" == "@COMPILER@" (
|
|||||||
set "TK_DIR=@3RDPARTY_TK_DLL_DIR@"
|
set "TK_DIR=@3RDPARTY_TK_DLL_DIR@"
|
||||||
set "FREETYPE_DIR=@3RDPARTY_FREETYPE_DLL_DIR@"
|
set "FREETYPE_DIR=@3RDPARTY_FREETYPE_DLL_DIR@"
|
||||||
set "FREEIMAGE_DIR=@3RDPARTY_FREEIMAGE_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 "GL2PS_DIR=@3RDPARTY_GL2PS_DLL_DIR@"
|
||||||
set "TBB_DIR=@3RDPARTY_TBB_DLL_DIR@"
|
set "TBB_DIR=@3RDPARTY_TBB_DLL_DIR@"
|
||||||
set "VTK_DIR=@3RDPARTY_VTK_DLL_DIR@"
|
set "VTK_DIR=@3RDPARTY_VTK_DLL_DIR@"
|
||||||
|
@ -8,6 +8,8 @@ if /I "%VCVER%" == "@COMPILER@" (
|
|||||||
set "TK_DIR=@USED_3RDPARTY_TK_DIR@"
|
set "TK_DIR=@USED_3RDPARTY_TK_DIR@"
|
||||||
set "FREETYPE_DIR=@USED_3RDPARTY_FREETYPE_DIR@"
|
set "FREETYPE_DIR=@USED_3RDPARTY_FREETYPE_DIR@"
|
||||||
set "FREEIMAGE_DIR=@USED_3RDPARTY_FREEIMAGE_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 "GL2PS_DIR=@USED_3RDPARTY_GL2PS_DIR@"
|
||||||
set "TBB_DIR=@USED_3RDPARTY_TBB_DIR@"
|
set "TBB_DIR=@USED_3RDPARTY_TBB_DIR@"
|
||||||
set "VTK_DIR=@USED_3RDPARTY_VTK_DIR@"
|
set "VTK_DIR=@USED_3RDPARTY_VTK_DIR@"
|
||||||
|
@ -20,6 +20,7 @@ set "HAVE_OPENCL=false"
|
|||||||
set "HAVE_FREEIMAGE=false"
|
set "HAVE_FREEIMAGE=false"
|
||||||
set "HAVE_GL2PS=false"
|
set "HAVE_GL2PS=false"
|
||||||
set "HAVE_VTK=false"
|
set "HAVE_VTK=false"
|
||||||
|
set "HAVE_GLES2=false"
|
||||||
set "HAVE_D3D=false"
|
set "HAVE_D3D=false"
|
||||||
set "CSF_OPT_INC="
|
set "CSF_OPT_INC="
|
||||||
set "CSF_OPT_LIB32="
|
set "CSF_OPT_LIB32="
|
||||||
@ -62,12 +63,14 @@ if ["%HAVE_OPENCL%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DH
|
|||||||
if ["%HAVE_GL2PS%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GL2PS"
|
if ["%HAVE_GL2PS%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_GL2PS"
|
||||||
if ["%HAVE_FREEIMAGE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE"
|
if ["%HAVE_FREEIMAGE%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_FREEIMAGE"
|
||||||
if ["%HAVE_VTK%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_VTK"
|
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_D3D%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_D3D"
|
||||||
if ["%HAVE_TBB%"] == ["true"] set "CSF_DEFINES=HAVE_TBB;%CSF_DEFINES%"
|
if ["%HAVE_TBB%"] == ["true"] set "CSF_DEFINES=HAVE_TBB;%CSF_DEFINES%"
|
||||||
if ["%HAVE_OPENCL%"] == ["true"] set "CSF_DEFINES=HAVE_OPENCL;%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_GL2PS%"] == ["true"] set "CSF_DEFINES=HAVE_GL2PS;%CSF_DEFINES%"
|
||||||
if ["%HAVE_FREEIMAGE%"] == ["true"] set "CSF_DEFINES=HAVE_FREEIMAGE;%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_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%"
|
if ["%HAVE_D3D%"] == ["true"] set "CSF_DEFINES=HAVE_D3D;%CSF_DEFINES%"
|
||||||
|
|
||||||
rem Eliminate VS warning
|
rem Eliminate VS warning
|
||||||
|
@ -29,6 +29,8 @@ if not ["%TCL_DIR%"] == [""] set "PATH=%TCL_DIR%;%PATH%"
|
|||||||
if not ["%TK_DIR%"] == [""] set "PATH=%TK_DIR%;%PATH%"
|
if not ["%TK_DIR%"] == [""] set "PATH=%TK_DIR%;%PATH%"
|
||||||
if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%"
|
if not ["%FREETYPE_DIR%"] == [""] set "PATH=%FREETYPE_DIR%;%PATH%"
|
||||||
if not ["%FREEIMAGE_DIR%"] == [""] set "PATH=%FREEIMAGE_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 ["%GL2PS_DIR%"] == [""] set "PATH=%GL2PS_DIR%;%PATH%"
|
||||||
if not ["%TBB_DIR%"] == [""] set "PATH=%TBB_DIR%;%PATH%"
|
if not ["%TBB_DIR%"] == [""] set "PATH=%TBB_DIR%;%PATH%"
|
||||||
if not ["%VTK_DIR%"] == [""] set "PATH=%VTK_DIR%;%PATH%"
|
if not ["%VTK_DIR%"] == [""] set "PATH=%VTK_DIR%;%PATH%"
|
||||||
|
@ -12,6 +12,7 @@ export HAVE_OPENCL="false";
|
|||||||
export HAVE_FREEIMAGE="false";
|
export HAVE_FREEIMAGE="false";
|
||||||
export HAVE_GL2PS="false";
|
export HAVE_GL2PS="false";
|
||||||
export HAVE_VTK="false";
|
export HAVE_VTK="false";
|
||||||
|
export HAVE_GLES2="false";
|
||||||
export MACOSX_USE_GLX="false";
|
export MACOSX_USE_GLX="false";
|
||||||
export CSF_OPT_INC=""
|
export CSF_OPT_INC=""
|
||||||
export CSF_OPT_LIB32=""
|
export CSF_OPT_LIB32=""
|
||||||
@ -102,6 +103,9 @@ fi
|
|||||||
if [ "$HAVE_GL2PS" == "true" ]; then
|
if [ "$HAVE_GL2PS" == "true" ]; then
|
||||||
export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GL2PS"
|
export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GL2PS"
|
||||||
fi
|
fi
|
||||||
|
if [ "$HAVE_GLES2" == "true" ]; then
|
||||||
|
export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GLES2"
|
||||||
|
fi
|
||||||
if [ "$HAVE_VTK" == "true" ]; then
|
if [ "$HAVE_VTK" == "true" ]; then
|
||||||
export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"
|
export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"
|
||||||
fi
|
fi
|
||||||
|
111
src/Aspect/Aspect_NeutralWindow.cxx
Normal file
111
src/Aspect/Aspect_NeutralWindow.cxx
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
// 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;
|
||||||
|
}
|
123
src/Aspect/Aspect_NeutralWindow.hxx
Normal file
123
src/Aspect/Aspect_NeutralWindow.hxx
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
// 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
|
@ -25,6 +25,8 @@ Aspect_Grid.cxx
|
|||||||
Aspect_Grid.hxx
|
Aspect_Grid.hxx
|
||||||
Aspect_GridDrawMode.hxx
|
Aspect_GridDrawMode.hxx
|
||||||
Aspect_GridType.hxx
|
Aspect_GridType.hxx
|
||||||
|
Aspect_NeutralWindow.cxx
|
||||||
|
Aspect_NeutralWindow.hxx
|
||||||
Aspect_Handle.hxx
|
Aspect_Handle.hxx
|
||||||
Aspect_HatchStyle.hxx
|
Aspect_HatchStyle.hxx
|
||||||
Aspect_IdentDefinitionError.hxx
|
Aspect_IdentDefinitionError.hxx
|
||||||
|
@ -316,7 +316,10 @@ void Font_FontMgr::InitFontDataBase()
|
|||||||
myListOfFonts.Clear();
|
myListOfFonts.Clear();
|
||||||
Handle(Font_FTLibrary) aFtLibrary;
|
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\"
|
// font directory is placed in "C:\Windows\Fonts\"
|
||||||
UINT aStrLength = GetSystemWindowsDirectoryA (NULL, 0);
|
UINT aStrLength = GetSystemWindowsDirectoryA (NULL, 0);
|
||||||
|
@ -240,13 +240,22 @@ Standard_Integer OSD_Environment::Error() const
|
|||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
#include <NCollection_DataMap.hxx>
|
||||||
#include <NCollection_UtfString.hxx>
|
#include <NCollection_UtfString.hxx>
|
||||||
|
#include <Standard_Mutex.hxx>
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#pragma warning( disable : 4700 )
|
#pragma warning( disable : 4700 )
|
||||||
#endif
|
#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 );
|
static void __fastcall _set_error ( OSD_Error&, DWORD );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -278,9 +287,11 @@ void OSD_Environment :: SetValue ( const TCollection_AsciiString& Value ) {
|
|||||||
|
|
||||||
TCollection_AsciiString OSD_Environment::Value()
|
TCollection_AsciiString OSD_Environment::Value()
|
||||||
{
|
{
|
||||||
#ifndef OCCT_UWP
|
|
||||||
myValue.Clear();
|
myValue.Clear();
|
||||||
|
#ifdef OCCT_UWP
|
||||||
|
Standard_Mutex::Sentry aLock (THE_ENV_LOCK);
|
||||||
|
THE_ENV_MAP.Find (myName, myValue);
|
||||||
|
#else
|
||||||
SetLastError (ERROR_SUCCESS);
|
SetLastError (ERROR_SUCCESS);
|
||||||
wchar_t* anEnvVal = NULL;
|
wchar_t* anEnvVal = NULL;
|
||||||
NCollection_UtfWideString aNameWide (myName.ToCString());
|
NCollection_UtfWideString aNameWide (myName.ToCString());
|
||||||
@ -308,11 +319,8 @@ TCollection_AsciiString OSD_Environment::Value()
|
|||||||
Reset();
|
Reset();
|
||||||
}
|
}
|
||||||
myValue = aValue.ToCString();
|
myValue = aValue.ToCString();
|
||||||
return myValue;
|
|
||||||
#else
|
|
||||||
myValue = "";
|
|
||||||
return myValue;
|
|
||||||
#endif
|
#endif
|
||||||
|
return myValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSD_Environment :: SetName ( const TCollection_AsciiString& name ) {
|
void OSD_Environment :: SetName ( const TCollection_AsciiString& name ) {
|
||||||
@ -329,7 +337,10 @@ TCollection_AsciiString OSD_Environment :: Name () const {
|
|||||||
|
|
||||||
void OSD_Environment::Build()
|
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();
|
NCollection_Utf8String aSetVariable = NCollection_Utf8String(myName.ToCString()) + "=" + myValue.ToCString();
|
||||||
_wputenv (aSetVariable.ToUtfWide().ToCString());
|
_wputenv (aSetVariable.ToUtfWide().ToCString());
|
||||||
#endif
|
#endif
|
||||||
@ -337,7 +348,10 @@ void OSD_Environment::Build()
|
|||||||
|
|
||||||
void OSD_Environment::Remove()
|
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()) + "=";
|
NCollection_Utf8String aSetVariable = NCollection_Utf8String(myName.ToCString()) + "=";
|
||||||
_wputenv (aSetVariable.ToUtfWide().ToCString());
|
_wputenv (aSetVariable.ToUtfWide().ToCString());
|
||||||
#endif
|
#endif
|
||||||
|
@ -363,6 +363,7 @@ void OSD::SetSignal (const Standard_Boolean theFloatingSignal)
|
|||||||
{
|
{
|
||||||
#if !defined(__CYGWIN32__) && !defined(__MINGW32__)
|
#if !defined(__CYGWIN32__) && !defined(__MINGW32__)
|
||||||
Standard_Mutex::Sentry aSentry (THE_SIGNAL_MUTEX); // lock the mutex to prevent simultaneous handling
|
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;
|
LPTOP_LEVEL_EXCEPTION_FILTER aPreviousFilter;
|
||||||
|
|
||||||
OSD_Environment env ("CSF_DEBUG_MODE");
|
OSD_Environment env ("CSF_DEBUG_MODE");
|
||||||
@ -382,6 +383,7 @@ void OSD::SetSignal (const Standard_Boolean theFloatingSignal)
|
|||||||
// Replaces the existing top-level exception filter for all existing and all future threads
|
// Replaces the existing top-level exception filter for all existing and all future threads
|
||||||
// in the calling process
|
// in the calling process
|
||||||
aPreviousFilter = ::SetUnhandledExceptionFilter (/*(LPTOP_LEVEL_EXCEPTION_FILTER)*/ WntHandler);
|
aPreviousFilter = ::SetUnhandledExceptionFilter (/*(LPTOP_LEVEL_EXCEPTION_FILTER)*/ WntHandler);
|
||||||
|
#endif // NTDDI_WIN10_TH2
|
||||||
|
|
||||||
// Signal handlers will only be used when the method ::raise() will be used
|
// Signal handlers will only be used when the method ::raise() will be used
|
||||||
// Handlers must be set for every thread
|
// Handlers must be set for every thread
|
||||||
|
@ -16,10 +16,13 @@
|
|||||||
#ifndef __OPENGL_AVIWRITER_H
|
#ifndef __OPENGL_AVIWRITER_H
|
||||||
#define __OPENGL_AVIWRITER_H
|
#define __OPENGL_AVIWRITER_H
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#if defined(_WIN32)
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define THIS void
|
#include <Standard_Macro.hxx>
|
||||||
#include <windows.h>
|
|
||||||
|
#if defined(_MSC_VER) && !defined(OCCT_UWP)
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <vfw.h>
|
#include <vfw.h>
|
||||||
|
@ -134,6 +134,7 @@ OpenGl_Context::OpenGl_Context (const Handle(OpenGl_Caps)& theCaps)
|
|||||||
arbDbg (NULL),
|
arbDbg (NULL),
|
||||||
arbFBO (NULL),
|
arbFBO (NULL),
|
||||||
arbFBOBlit (NULL),
|
arbFBOBlit (NULL),
|
||||||
|
extFragDepth (Standard_False),
|
||||||
extGS (NULL),
|
extGS (NULL),
|
||||||
extBgra(Standard_False),
|
extBgra(Standard_False),
|
||||||
extAnis(Standard_False),
|
extAnis(Standard_False),
|
||||||
@ -1200,6 +1201,8 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile)
|
|||||||
{
|
{
|
||||||
arbFBOBlit = (OpenGl_ArbFBOBlit* )(&(*myFuncs));
|
arbFBOBlit = (OpenGl_ArbFBOBlit* )(&(*myFuncs));
|
||||||
}
|
}
|
||||||
|
extFragDepth = !IsGlGreaterEqual(3, 0)
|
||||||
|
&& CheckExtension ("GL_EXT_frag_depth");
|
||||||
if (IsGlGreaterEqual (3, 1)
|
if (IsGlGreaterEqual (3, 1)
|
||||||
&& FindProc ("glTexStorage2DMultisample", myFuncs->glTexStorage2DMultisample))
|
&& FindProc ("glTexStorage2DMultisample", myFuncs->glTexStorage2DMultisample))
|
||||||
{
|
{
|
||||||
|
@ -721,6 +721,7 @@ public: //! @name extensions
|
|||||||
OpenGl_ArbDbg* arbDbg; //!< GL_ARB_debug_output
|
OpenGl_ArbDbg* arbDbg; //!< GL_ARB_debug_output
|
||||||
OpenGl_ArbFBO* arbFBO; //!< GL_ARB_framebuffer_object
|
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
|
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
|
OpenGl_ExtGS* extGS; //!< GL_EXT_geometry_shader4
|
||||||
Standard_Boolean extBgra; //!< GL_EXT_bgra or GL_EXT_texture_format_BGRA8888 on OpenGL ES
|
Standard_Boolean extBgra; //!< GL_EXT_bgra or GL_EXT_texture_format_BGRA8888 on OpenGL ES
|
||||||
Standard_Boolean extAnis; //!< GL_EXT_texture_filter_anisotropic
|
Standard_Boolean extAnis; //!< GL_EXT_texture_filter_anisotropic
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#include <Standard_TypeDef.hxx>
|
||||||
|
|
||||||
#ifndef APIENTRY
|
#ifndef APIENTRY
|
||||||
#define APIENTRY
|
#define APIENTRY
|
||||||
#endif
|
#endif
|
||||||
@ -45,7 +48,12 @@
|
|||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
#endif
|
#endif
|
||||||
#define __X_GL_H // prevent chaotic gl.h inclusions to avoid compile errors
|
#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 <GLES2/gl2.h>
|
||||||
//#include <GLES3/gl3.h>
|
//#include <GLES3/gl3.h>
|
||||||
#else
|
#else
|
||||||
@ -178,7 +186,7 @@
|
|||||||
#define GL_DEBUG_SEVERITY_LOW 0x9148
|
#define GL_DEBUG_SEVERITY_LOW 0x9148
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__ANDROID__) || defined(__QNX__)
|
#if !defined(HAVE_EGL) && (defined(__ANDROID__) || defined(__QNX__) || defined(HAVE_GLES2) || defined(OCCT_UWP))
|
||||||
#define HAVE_EGL
|
#define HAVE_EGL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -13,6 +13,10 @@
|
|||||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||||
// commercial license or contractual agreement.
|
// commercial license or contractual agreement.
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <OpenGl_GraphicDriver.hxx>
|
#include <OpenGl_GraphicDriver.hxx>
|
||||||
#include <OpenGl_Context.hxx>
|
#include <OpenGl_Context.hxx>
|
||||||
#include <OpenGl_Flipper.hxx>
|
#include <OpenGl_Flipper.hxx>
|
||||||
@ -44,7 +48,7 @@ IMPLEMENT_STANDARD_RTTIEXT(OpenGl_GraphicDriver,Graphic3d_GraphicDriver)
|
|||||||
#include <X11/Xlib.h> // XOpenDisplay()
|
#include <X11/Xlib.h> // XOpenDisplay()
|
||||||
#endif
|
#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>
|
#include <EGL/egl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -61,7 +65,7 @@ OpenGl_GraphicDriver::OpenGl_GraphicDriver (const Handle(Aspect_DisplayConnectio
|
|||||||
const Standard_Boolean theToInitialize)
|
const Standard_Boolean theToInitialize)
|
||||||
: Graphic3d_GraphicDriver (theDisp),
|
: Graphic3d_GraphicDriver (theDisp),
|
||||||
myIsOwnContext (Standard_False),
|
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),
|
myEglDisplay ((Aspect_Display )EGL_NO_DISPLAY),
|
||||||
myEglContext ((Aspect_RenderingContext )EGL_NO_CONTEXT),
|
myEglContext ((Aspect_RenderingContext )EGL_NO_CONTEXT),
|
||||||
myEglConfig (NULL),
|
myEglConfig (NULL),
|
||||||
@ -82,7 +86,7 @@ OpenGl_GraphicDriver::OpenGl_GraphicDriver (const Handle(Aspect_DisplayConnectio
|
|||||||
|| ::getenv ("CALL_SYNCHRO_X") != NULL;
|
|| ::getenv ("CALL_SYNCHRO_X") != NULL;
|
||||||
XSynchronize (aDisplay, toSync);
|
XSynchronize (aDisplay, toSync);
|
||||||
|
|
||||||
#if !defined(HAVE_EGL)
|
#if !defined(HAVE_EGL) && !defined(HAVE_GLES2)
|
||||||
// does the server know about OpenGL & GLX?
|
// does the server know about OpenGL & GLX?
|
||||||
int aDummy;
|
int aDummy;
|
||||||
if (!XQueryExtension (aDisplay, "GLX", &aDummy, &aDummy, &aDummy))
|
if (!XQueryExtension (aDisplay, "GLX", &aDummy, &aDummy, &aDummy))
|
||||||
@ -206,7 +210,7 @@ void OpenGl_GraphicDriver::ReleaseContext()
|
|||||||
aWindow->GetGlContext()->forcedRelease();
|
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 (myIsOwnContext)
|
||||||
{
|
{
|
||||||
if (myEglContext != (Aspect_RenderingContext )EGL_NO_CONTEXT)
|
if (myEglContext != (Aspect_RenderingContext )EGL_NO_CONTEXT)
|
||||||
@ -241,7 +245,7 @@ void OpenGl_GraphicDriver::ReleaseContext()
|
|||||||
Standard_Boolean OpenGl_GraphicDriver::InitContext()
|
Standard_Boolean OpenGl_GraphicDriver::InitContext()
|
||||||
{
|
{
|
||||||
ReleaseContext();
|
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 !defined(_WIN32) && !defined(__ANDROID__) && !defined(__QNX__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
|
||||||
if (myDisplayConnection.IsNull())
|
if (myDisplayConnection.IsNull())
|
||||||
@ -322,17 +326,18 @@ Standard_Boolean OpenGl_GraphicDriver::InitContext()
|
|||||||
::Message::DefaultMessenger()->Send ("Error: EGL is unable to create OpenGL context!", Message_Fail);
|
::Message::DefaultMessenger()->Send ("Error: EGL is unable to create OpenGL context!", Message_Fail);
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
if (eglMakeCurrent ((EGLDisplay )myEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, (EGLContext )myEglContext) != EGL_TRUE)
|
// 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;
|
// ::Message::DefaultMessenger()->Send ("Error: EGL is unable bind OpenGL context!", Message_Fail);
|
||||||
}
|
// return Standard_False;
|
||||||
|
//}
|
||||||
#endif
|
#endif
|
||||||
myIsOwnContext = Standard_True;
|
myIsOwnContext = Standard_True;
|
||||||
return 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
|
// function : InitEglContext
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -778,7 +783,7 @@ Standard_Boolean OpenGl_GraphicDriver::ViewExists (const Handle(Aspect_Window)&
|
|||||||
// Parse the list of views to find
|
// Parse the list of views to find
|
||||||
// a view with the specified window
|
// 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);
|
const Handle(WNT_Window) THEWindow = Handle(WNT_Window)::DownCast (AWindow);
|
||||||
Aspect_Handle TheSpecifiedWindowId = THEWindow->HWindow ();
|
Aspect_Handle TheSpecifiedWindowId = THEWindow->HWindow ();
|
||||||
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
|
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
|
||||||
@ -788,7 +793,7 @@ Standard_Boolean OpenGl_GraphicDriver::ViewExists (const Handle(Aspect_Window)&
|
|||||||
#else
|
#else
|
||||||
NSView* TheSpecifiedWindowId = THEWindow->HView();
|
NSView* TheSpecifiedWindowId = THEWindow->HView();
|
||||||
#endif
|
#endif
|
||||||
#elif defined(__ANDROID__) || defined(__QNX__)
|
#elif defined(__ANDROID__) || defined(__QNX__) || defined(OCCT_UWP)
|
||||||
(void )AWindow;
|
(void )AWindow;
|
||||||
int TheSpecifiedWindowId = -1;
|
int TheSpecifiedWindowId = -1;
|
||||||
#else
|
#else
|
||||||
@ -804,7 +809,7 @@ Standard_Boolean OpenGl_GraphicDriver::ViewExists (const Handle(Aspect_Window)&
|
|||||||
{
|
{
|
||||||
const Handle(Aspect_Window) AspectWindow = aView->Window();
|
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);
|
const Handle(WNT_Window) theWindow = Handle(WNT_Window)::DownCast (AspectWindow);
|
||||||
Aspect_Handle TheWindowIdOfView = theWindow->HWindow ();
|
Aspect_Handle TheWindowIdOfView = theWindow->HWindow ();
|
||||||
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
|
#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
|
||||||
@ -814,7 +819,7 @@ Standard_Boolean OpenGl_GraphicDriver::ViewExists (const Handle(Aspect_Window)&
|
|||||||
#else
|
#else
|
||||||
NSView* TheWindowIdOfView = theWindow->HView();
|
NSView* TheWindowIdOfView = theWindow->HView();
|
||||||
#endif
|
#endif
|
||||||
#elif defined(__ANDROID__) || defined(__QNX__)
|
#elif defined(__ANDROID__) || defined(__QNX__) || defined(OCCT_UWP)
|
||||||
int TheWindowIdOfView = 0;
|
int TheWindowIdOfView = 0;
|
||||||
#else
|
#else
|
||||||
const Handle(Xw_Window) theWindow = Handle(Xw_Window)::DownCast (AspectWindow);
|
const Handle(Xw_Window) theWindow = Handle(Xw_Window)::DownCast (AspectWindow);
|
||||||
|
@ -100,7 +100,7 @@ public:
|
|||||||
//! Perform initialization of default OpenGL context.
|
//! Perform initialization of default OpenGL context.
|
||||||
Standard_EXPORT Standard_Boolean InitContext();
|
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.
|
//! Initialize default OpenGL context using existing one.
|
||||||
//! @param theEglDisplay EGL connection to the Display
|
//! @param theEglDisplay EGL connection to the Display
|
||||||
//! @param theEglContext EGL rendering context
|
//! @param theEglContext EGL rendering context
|
||||||
@ -193,7 +193,7 @@ public:
|
|||||||
//! Could return NULL-handle if no window created by this driver.
|
//! Could return NULL-handle if no window created by this driver.
|
||||||
Standard_EXPORT const Handle(OpenGl_Context)& GetSharedContext() const;
|
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_Display getRawGlDisplay() const { return myEglDisplay; }
|
||||||
Aspect_RenderingContext getRawGlContext() const { return myEglContext; }
|
Aspect_RenderingContext getRawGlContext() const { return myEglContext; }
|
||||||
void* getRawGlConfig() const { return myEglConfig; }
|
void* getRawGlConfig() const { return myEglConfig; }
|
||||||
@ -209,7 +209,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
Standard_Boolean myIsOwnContext; //!< indicates that shared context has been created within OpenGl_GraphicDriver
|
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_Display myEglDisplay; //!< EGL connection to the Display : EGLDisplay
|
||||||
Aspect_RenderingContext myEglContext; //!< EGL rendering context : EGLContext
|
Aspect_RenderingContext myEglContext; //!< EGL rendering context : EGLContext
|
||||||
void* myEglConfig; //!< EGL configuration : EGLConfig
|
void* myEglConfig; //!< EGL configuration : EGLConfig
|
||||||
|
@ -913,6 +913,11 @@ Standard_Boolean OpenGl_ShaderManager::prepareStdProgramFboBlit()
|
|||||||
{
|
{
|
||||||
aProgramSrc->SetHeader ("#version 300 es");
|
aProgramSrc->SetHeader ("#version 300 es");
|
||||||
}
|
}
|
||||||
|
else if (myContext->extFragDepth)
|
||||||
|
{
|
||||||
|
aProgramSrc->SetHeader ("#extension GL_EXT_frag_depth : enable"
|
||||||
|
EOL"#define gl_FragDepth gl_FragDepthEXT");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// there is no way to draw into depth buffer
|
// there is no way to draw into depth buffer
|
||||||
|
@ -1388,6 +1388,13 @@ bool OpenGl_View::blitBuffers (OpenGl_FrameBuffer* theReadFbo,
|
|||||||
aCtx->core20fwd->glDepthFunc (GL_ALWAYS);
|
aCtx->core20fwd->glDepthFunc (GL_ALWAYS);
|
||||||
aCtx->core20fwd->glDepthMask (GL_TRUE);
|
aCtx->core20fwd->glDepthMask (GL_TRUE);
|
||||||
aCtx->core20fwd->glEnable (GL_DEPTH_TEST);
|
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();
|
myWorkspace->DisableTexture();
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Window,MMgt_TShared)
|
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Window,MMgt_TShared)
|
||||||
|
|
||||||
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
|
#if defined(HAVE_EGL)
|
||||||
#include <EGL/egl.h>
|
#include <EGL/egl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Window,MMgt_TShared)
|
|||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
|
#if defined(HAVE_EGL)
|
||||||
//
|
//
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ OpenGl_Window::OpenGl_Window (const Handle(OpenGl_GraphicDriver)& theDriver,
|
|||||||
|
|
||||||
Standard_Boolean isCoreProfile = Standard_False;
|
Standard_Boolean isCoreProfile = Standard_False;
|
||||||
|
|
||||||
#if defined(HAVE_EGL) || defined(__ANDROID__) || defined(__QNX__)
|
#if defined(HAVE_EGL)
|
||||||
EGLDisplay anEglDisplay = (EGLDisplay )theDriver->getRawGlDisplay();
|
EGLDisplay anEglDisplay = (EGLDisplay )theDriver->getRawGlDisplay();
|
||||||
EGLContext anEglContext = (EGLContext )theDriver->getRawGlContext();
|
EGLContext anEglContext = (EGLContext )theDriver->getRawGlContext();
|
||||||
EGLConfig anEglConfig = (EGLConfig )theDriver->getRawGlConfig();
|
EGLConfig anEglConfig = (EGLConfig )theDriver->getRawGlConfig();
|
||||||
@ -616,7 +616,7 @@ OpenGl_Window::~OpenGl_Window()
|
|||||||
// release "GL" context if it is owned by window
|
// release "GL" context if it is owned by window
|
||||||
// Mesa implementation can fail to destroy GL context if it set for current thread.
|
// 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.
|
// 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)
|
if ((EGLSurface )myGlContext->myWindow != EGL_NO_SURFACE)
|
||||||
{
|
{
|
||||||
eglDestroySurface ((EGLDisplay )myGlContext->myDisplay,
|
eglDestroySurface ((EGLDisplay )myGlContext->myDisplay,
|
||||||
@ -678,7 +678,7 @@ Standard_Boolean OpenGl_Window::Activate()
|
|||||||
// =======================================================================
|
// =======================================================================
|
||||||
void OpenGl_Window::Resize()
|
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;
|
Display* aDisp = (Display* )myGlContext->myDisplay;
|
||||||
if (aDisp == NULL)
|
if (aDisp == NULL)
|
||||||
return;
|
return;
|
||||||
@ -695,7 +695,7 @@ void OpenGl_Window::Resize()
|
|||||||
myWidth = aWidth;
|
myWidth = aWidth;
|
||||||
myHeight = aHeight;
|
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);
|
XResizeWindow (aDisp, myGlContext->myWindow, (unsigned int )myWidth, (unsigned int )myHeight);
|
||||||
XSync (aDisp, False);
|
XSync (aDisp, False);
|
||||||
#endif
|
#endif
|
||||||
@ -712,7 +712,7 @@ void OpenGl_Window::Init()
|
|||||||
if (!Activate())
|
if (!Activate())
|
||||||
return;
|
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_WIDTH, &myWidth);
|
||||||
eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_HEIGHT, &myHeight);
|
eglQuerySurface ((EGLDisplay )myGlContext->myDisplay, (EGLSurface )myGlContext->myWindow, EGL_HEIGHT, &myHeight);
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
|
@ -13,14 +13,6 @@
|
|||||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||||
// commercial license or contractual agreement.
|
// 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_Mutex.hxx>
|
||||||
#include <Standard_OStream.hxx>
|
#include <Standard_OStream.hxx>
|
||||||
|
|
||||||
|
@ -165,6 +165,7 @@ void VUserDrawObj::Render(const Handle(OpenGl_Workspace)& theWorkspace) const
|
|||||||
aTA->Aspect()->Font();
|
aTA->Aspect()->Font();
|
||||||
OpenGl_Vec4 aColor = theWorkspace->LineColor();
|
OpenGl_Vec4 aColor = theWorkspace->LineColor();
|
||||||
|
|
||||||
|
#if !defined(GL_ES_VERSION_2_0)
|
||||||
// Finally draw something to make sure UserDraw really works
|
// Finally draw something to make sure UserDraw really works
|
||||||
glPushAttrib(GL_ENABLE_BIT);
|
glPushAttrib(GL_ENABLE_BIT);
|
||||||
glDisable(GL_LIGHTING);
|
glDisable(GL_LIGHTING);
|
||||||
@ -176,6 +177,7 @@ void VUserDrawObj::Render(const Handle(OpenGl_Workspace)& theWorkspace) const
|
|||||||
glVertex3f(myCoords[0], myCoords[1], myCoords[5]);
|
glVertex3f(myCoords[0], myCoords[1], myCoords[5]);
|
||||||
glEnd();
|
glEnd();
|
||||||
glPopAttrib();
|
glPopAttrib();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end of anonymous namespace
|
} // end of anonymous namespace
|
||||||
@ -222,6 +224,7 @@ static int VFeedback (Draw_Interpretor& theDI,
|
|||||||
Standard_Integer /*theArgNb*/,
|
Standard_Integer /*theArgNb*/,
|
||||||
const char** /*theArgVec*/)
|
const char** /*theArgVec*/)
|
||||||
{
|
{
|
||||||
|
#if !defined(GL_ES_VERSION_2_0)
|
||||||
// get the active view
|
// get the active view
|
||||||
Handle(V3d_View) aView = ViewerTest::CurrentView();
|
Handle(V3d_View) aView = ViewerTest::CurrentView();
|
||||||
if (aView.IsNull())
|
if (aView.IsNull())
|
||||||
@ -363,6 +366,11 @@ static int VFeedback (Draw_Interpretor& theDI,
|
|||||||
<< "Buffer size GL_3D_COLOR: " << aLen3D_rgba * double(sizeof(GLfloat)) / double(1024 * 1024) << " MiB\n";
|
<< "Buffer size GL_3D_COLOR: " << aLen3D_rgba * double(sizeof(GLfloat)) / double(1024 * 1024) << " MiB\n";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void )theDI;
|
||||||
|
std::cout << "Command is unsupported on current platform.\n";
|
||||||
|
return 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
@ -14,12 +14,15 @@
|
|||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
#include <WNT_WClass.hxx>
|
||||||
|
|
||||||
#include <Standard_PCharacter.hxx>
|
#include <Standard_PCharacter.hxx>
|
||||||
#include <Standard_Type.hxx>
|
#include <Standard_Type.hxx>
|
||||||
#include <WNT_ClassDefinitionError.hxx>
|
#include <WNT_ClassDefinitionError.hxx>
|
||||||
#include <WNT_WClass.hxx>
|
|
||||||
#include <WNT_Window.hxx>
|
#include <WNT_Window.hxx>
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(OCCT_UWP)
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(WNT_WClass,MMgt_TShared)
|
IMPLEMENT_STANDARD_RTTIEXT(WNT_WClass,MMgt_TShared)
|
||||||
|
|
||||||
@ -78,3 +81,4 @@ WNT_WClass::~WNT_WClass ()
|
|||||||
|
|
||||||
} // end WNT_WClass :: Destroy
|
} // end WNT_WClass :: Destroy
|
||||||
|
|
||||||
|
#endif // _WIN32
|
||||||
|
@ -18,8 +18,10 @@
|
|||||||
#define _WNT_WClass_HeaderFile
|
#define _WNT_WClass_HeaderFile
|
||||||
|
|
||||||
#include <Standard.hxx>
|
#include <Standard.hxx>
|
||||||
#include <Standard_Type.hxx>
|
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(OCCT_UWP)
|
||||||
|
|
||||||
|
#include <Standard_Type.hxx>
|
||||||
#include <Standard_CString.hxx>
|
#include <Standard_CString.hxx>
|
||||||
#include <Aspect_Handle.hxx>
|
#include <Aspect_Handle.hxx>
|
||||||
#include <Standard_Address.hxx>
|
#include <Standard_Address.hxx>
|
||||||
@ -80,24 +82,13 @@ friend class WNT_Window;
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
||||||
Standard_CString lpszName;
|
Standard_CString lpszName;
|
||||||
Aspect_Handle hInstance;
|
Aspect_Handle hInstance;
|
||||||
Standard_Address lpfnWndProc;
|
Standard_Address lpfnWndProc;
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#include <WNT_WClass.lxx>
|
#include <WNT_WClass.lxx>
|
||||||
|
|
||||||
|
#endif // _WIN32
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _WNT_WClass_HeaderFile
|
#endif // _WNT_WClass_HeaderFile
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
// include windows.h first to have all definitions available
|
// include windows.h first to have all definitions available
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
#include <WNT_Window.hxx>
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(OCCT_UWP)
|
||||||
|
|
||||||
#include <Aspect_Convert.hxx>
|
#include <Aspect_Convert.hxx>
|
||||||
#include <Aspect_WindowDefinitionError.hxx>
|
#include <Aspect_WindowDefinitionError.hxx>
|
||||||
@ -22,7 +25,6 @@
|
|||||||
#include <Image_AlienPixMap.hxx>
|
#include <Image_AlienPixMap.hxx>
|
||||||
#include <Standard_Type.hxx>
|
#include <Standard_Type.hxx>
|
||||||
#include <WNT_WClass.hxx>
|
#include <WNT_WClass.hxx>
|
||||||
#include <WNT_Window.hxx>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@ -354,3 +356,5 @@ void WNT_Window::SetPos (const Standard_Integer theX, const Standard_Integer th
|
|||||||
aXRight = theX1;
|
aXRight = theX1;
|
||||||
aYBottom = theY1;
|
aYBottom = theY1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // _WIN32
|
||||||
|
@ -18,8 +18,10 @@
|
|||||||
#define _WNT_Window_HeaderFile
|
#define _WNT_Window_HeaderFile
|
||||||
|
|
||||||
#include <Standard.hxx>
|
#include <Standard.hxx>
|
||||||
#include <Standard_Type.hxx>
|
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(OCCT_UWP)
|
||||||
|
|
||||||
|
#include <Standard_Type.hxx>
|
||||||
#include <Standard_Integer.hxx>
|
#include <Standard_Integer.hxx>
|
||||||
#include <Aspect_Handle.hxx>
|
#include <Aspect_Handle.hxx>
|
||||||
#include <Standard_Boolean.hxx>
|
#include <Standard_Boolean.hxx>
|
||||||
@ -118,7 +120,6 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
||||||
Standard_Integer aXLeft;
|
Standard_Integer aXLeft;
|
||||||
Standard_Integer aYTop;
|
Standard_Integer aYTop;
|
||||||
Standard_Integer aXRight;
|
Standard_Integer aXRight;
|
||||||
@ -128,19 +129,9 @@ protected:
|
|||||||
Aspect_Handle myHParentWindow;
|
Aspect_Handle myHParentWindow;
|
||||||
Standard_Boolean myIsForeign;
|
Standard_Boolean myIsForeign;
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#include <WNT_Window.lxx>
|
#include <WNT_Window.lxx>
|
||||||
|
|
||||||
|
#endif // _WIN32
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _WNT_Window_HeaderFile
|
#endif // _WNT_Window_HeaderFile
|
||||||
|
Loading…
x
Reference in New Issue
Block a user