|
@@ -71,9 +71,14 @@ if (URHO3D_TESTING)
|
|
|
else ()
|
|
else ()
|
|
|
unset (URHO3D_TEST_TIME_OUT CACHE)
|
|
unset (URHO3D_TEST_TIME_OUT CACHE)
|
|
|
endif ()
|
|
endif ()
|
|
|
|
|
+# The URHO3D_OPENGL option is not defined on non-Windows platforms as they should always use OpenGL
|
|
|
if (MSVC)
|
|
if (MSVC)
|
|
|
|
|
+ # On MSVC compiler, default to false (i.e. prefers Direct3D)
|
|
|
|
|
+ # OpenGL can be manually enabled with -DURHO3D_OPENGL=1, but Windows graphics card drivers are usually better optimized for Direct3D
|
|
|
option (URHO3D_OPENGL "Use OpenGL instead of Direct3D (Windows platform only)")
|
|
option (URHO3D_OPENGL "Use OpenGL instead of Direct3D (Windows platform only)")
|
|
|
elseif (WIN32)
|
|
elseif (WIN32)
|
|
|
|
|
+ # On non-MSVC compiler on Windows platform, default to true to enable use of OpenGL instead of Direct3D
|
|
|
|
|
+ # Direct3D can be manually enabled with -DURHO3D_OPENGL=0, but it is likely to fail unless the MinGW-w64 distribution is used due to dependency to Direct3D headers and libs
|
|
|
option (URHO3D_OPENGL "Use OpenGL instead of Direct3D (Windows platform only)" TRUE)
|
|
option (URHO3D_OPENGL "Use OpenGL instead of Direct3D (Windows platform only)" TRUE)
|
|
|
endif ()
|
|
endif ()
|
|
|
cmake_dependent_option (URHO3D_MKLINK "Use mklink command to create symbolic links (Windows Vista and above only)" FALSE "WIN32" FALSE)
|
|
cmake_dependent_option (URHO3D_MKLINK "Use mklink command to create symbolic links (Windows Vista and above only)" FALSE "WIN32" FALSE)
|
|
@@ -147,23 +152,17 @@ if (URHO3D_LOGGING)
|
|
|
add_definitions (-DURHO3D_LOGGING)
|
|
add_definitions (-DURHO3D_LOGGING)
|
|
|
endif ()
|
|
endif ()
|
|
|
|
|
|
|
|
-# If not on MSVC, enable use of OpenGL instead of Direct3D9 (either not compiling on Windows or
|
|
|
|
|
-# with a compiler that may not have an up-to-date DirectX SDK). This can also be unconditionally
|
|
|
|
|
-# enabled, but Windows graphics card drivers are usually better optimized for Direct3D. Direct3D can
|
|
|
|
|
-# be manually enabled for MinGW with -DURHO3D_OPENGL=0, but is likely to fail due to missing headers
|
|
|
|
|
-# and libraries, unless the MinGW-w64 distribution is used.
|
|
|
|
|
-if (NOT WIN32 OR NOT DEFINED URHO3D_OPENGL) # This option is only defined on Windows platform
|
|
|
|
|
|
|
+# If not on Windows platform, enable Unix mode for kNet library and OpenGL graphic back-end
|
|
|
|
|
+if (NOT WIN32)
|
|
|
|
|
+ add_definitions (-DUNIX)
|
|
|
set (URHO3D_OPENGL 1)
|
|
set (URHO3D_OPENGL 1)
|
|
|
endif ()
|
|
endif ()
|
|
|
|
|
+
|
|
|
|
|
+# Add definition for OpenGL
|
|
|
if (URHO3D_OPENGL)
|
|
if (URHO3D_OPENGL)
|
|
|
add_definitions (-DURHO3D_OPENGL)
|
|
add_definitions (-DURHO3D_OPENGL)
|
|
|
endif ()
|
|
endif ()
|
|
|
|
|
|
|
|
-# If not on Windows, enable Unix mode for kNet library.
|
|
|
|
|
-if (NOT WIN32)
|
|
|
|
|
- add_definitions (-DUNIX)
|
|
|
|
|
-endif ()
|
|
|
|
|
-
|
|
|
|
|
# Add definitions for GLEW
|
|
# Add definitions for GLEW
|
|
|
if (NOT IOS AND NOT ANDROID AND NOT RASPI AND URHO3D_OPENGL)
|
|
if (NOT IOS AND NOT ANDROID AND NOT RASPI AND URHO3D_OPENGL)
|
|
|
add_definitions (-DGLEW_STATIC -DGLEW_NO_GLU)
|
|
add_definitions (-DGLEW_STATIC -DGLEW_NO_GLU)
|