mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0026542: Visualization - Finalize support of D3D
D3DHost_View - fix compilation issues on old msvc compilers. CMake - add TKD3DHost. Cosmetic correction
This commit is contained in:
parent
050c18ac17
commit
f60111dc04
@ -68,6 +68,9 @@ endif()
|
||||
if (APPLE)
|
||||
set (USE_GLX OFF CACHE BOOL "${USE_GLX_DESCR}")
|
||||
endif()
|
||||
if (WIN32)
|
||||
set (USE_D3D OFF CACHE BOOL "${USE_D3D_DESCR}")
|
||||
endif()
|
||||
|
||||
set (USE_VTK OFF CACHE BOOL "${USE_VTK_DESCR}")
|
||||
|
||||
@ -91,6 +94,10 @@ if (NOT USE_VTK)
|
||||
list (REMOVE_ITEM Draw_TOOLKITS TKIVtkDraw)
|
||||
endif()
|
||||
|
||||
if (NOT USE_D3D)
|
||||
list (REMOVE_ITEM Visualization_TOOLKITS TKD3DHost)
|
||||
endif()
|
||||
|
||||
# accumulate used toolkits (first level) in BUILD_TOOLKITS variable
|
||||
list (APPEND BUILD_TOOLKITS ${BUILD_ADDITIONAL_TOOLKITS})
|
||||
|
||||
@ -182,6 +189,14 @@ else()
|
||||
OCCT_CHECK_AND_UNSET ("INSTALL_VTK")
|
||||
endif()
|
||||
|
||||
# D3D
|
||||
if (USE_D3D)
|
||||
add_definitions (-DHAVE_D3D)
|
||||
#if(MSVC_VERSION LESS 1700)
|
||||
#OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/d3d")
|
||||
#endif()
|
||||
endif()
|
||||
|
||||
# GLX
|
||||
if (USE_GLX)
|
||||
add_definitions (-DMACOSX_USE_GLX)
|
||||
|
@ -1,7 +1,7 @@
|
||||
FoundationClasses TKernel TKMath
|
||||
ModelingData TKG2d TKG3d TKGeomBase TKBRep
|
||||
ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
|
||||
Visualization TKService TKV3d TKOpenGl TKMeshVS TKIVtk
|
||||
Visualization TKService TKV3d TKOpenGl TKMeshVS TKIVtk TKD3DHost
|
||||
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml FWOSPlugin TKTObj TKBinTObj TKXmlTObj
|
||||
DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF
|
||||
Draw TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE
|
@ -106,6 +106,8 @@ VTK by means of its dedicated VIS component (VTK Integration Services).")
|
||||
|
||||
set (USE_GLX_DESCR "Indicates whether X11 OpenGl on OSX is used or not")
|
||||
|
||||
set (USE_D3D_DESCR "Indicates whether optional Direct3D wrapper in OCCT visualization module should be build or not")
|
||||
|
||||
macro (BUILD_MODULE MODULE_NAME)
|
||||
set (BUILD_MODULE_${MODULE_NAME} ON CACHE BOOL "${BUILD_MODULE_${MODULE_NAME}_DESCR}")
|
||||
endmacro()
|
||||
|
@ -24,6 +24,7 @@ set "HAVE_FREEIMAGE=false"
|
||||
set "HAVE_GL2PS=false"
|
||||
set "HAVE_OPENCL=false"
|
||||
set "HAVE_VTK=false"
|
||||
set "HAVE_D3D=false"
|
||||
set "CSF_OPT_INC="
|
||||
set "CSF_OPT_LIB32="
|
||||
set "CSF_OPT_LIB64="
|
||||
@ -67,11 +68,13 @@ if ["%HAVE_OPENCL%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DH
|
||||
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_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_D3D%"] == ["true"] set "CSF_DEFINES=HAVE_D3D;%CSF_DEFINES%"
|
||||
|
||||
rem Eliminate VS warning
|
||||
if ["%CSF_DEFINES%"] == [""] set "CSF_DEFINES=;"
|
||||
|
@ -51,8 +51,9 @@ D3DHost_View::D3DHost_View (const Handle(Graphic3d_StructureManager)& theMgr,
|
||||
myRefreshRate (D3DPRESENT_RATE_DEFAULT),
|
||||
myIsD3dEx (false)
|
||||
{
|
||||
myD3dParams = {};
|
||||
myCurrMode = {};
|
||||
memset(&myD3dParams, 0, sizeof(myD3dParams));
|
||||
memset(&myCurrMode, 0, sizeof(myCurrMode));
|
||||
|
||||
myD3dParams.Windowed = TRUE;
|
||||
myD3dParams.SwapEffect = D3DSWAPEFFECT_DISCARD;
|
||||
myD3dParams.BackBufferFormat = D3DFMT_X8R8G8B8;
|
||||
|
7
src/TKD3DHost/CMakeLists.txt
Normal file
7
src/TKD3DHost/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
project(TKD3DHost)
|
||||
|
||||
set (TOOLKIT_MODULES
|
||||
D3DHost
|
||||
)
|
||||
|
||||
include(${OCCT_SOURCE_DIR}/adm/cmake/occt_toolkit.cmake)
|
Loading…
x
Reference in New Issue
Block a user