Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eluther changes #2

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
add_subdirectory(source/Irrlicht)

option(BUILD_HEADLESS "Build in headless mode" ON)
option(BUILD_EXAMPLES "Build example applications" FALSE)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
Expand Down
6 changes: 4 additions & 2 deletions include/IrrCompileConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@
//! different library versions without having to change the sources.
//! Example: NO_IRR_COMPILE_WITH_X11_ would disable X11

//! Uncomment this line to compile with the SDL device
//#define _IRR_COMPILE_WITH_SDL_DEVICE_
#if BUILD_HEADLESS
#define _IRR_COMPILE_WITH_SDL_DEVICE_
#endif

#ifdef NO_IRR_COMPILE_WITH_SDL_DEVICE_
#undef _IRR_COMPILE_WITH_SDL_DEVICE_
#endif
Expand Down
2 changes: 1 addition & 1 deletion include/irrUString.h
Original file line number Diff line number Diff line change
Expand Up @@ -3678,7 +3678,7 @@ namespace unicode

//! Hashing algorithm for hashing a ustring. Used for things like unordered_maps.
//! Algorithm taken from std::hash<std::string>.
class hash : public std::unary_function<core::ustring, size_t>
class hash
{
public:
size_t operator()(const core::ustring& s) const
Expand Down
3 changes: 3 additions & 0 deletions source/Irrlicht/CIrrDeviceSDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,11 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
if ( ++SDLDeviceInstances == 1 )
{
u32 flags = SDL_INIT_TIMER | SDL_INIT_EVENTS;
#if BUILD_HEADLESS
#else
if (CreationParams.DriverType != video::EDT_NULL)
flags |= SDL_INIT_VIDEO;
#endif
#if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
flags |= SDL_INIT_JOYSTICK;
#endif
Expand Down
4 changes: 4 additions & 0 deletions source/Irrlicht/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ if(SDL_ENABLED)
find_package(SDL2 CONFIG REQUIRED)
message(STATUS "Found SDL2: ${SDL2_LIBRARIES}")
endif()
if(BUILD_HEADLESS)
find_package(SDL2 REQUIRED)
add_definitions(-DBUILD_HEADLESS=1)
endif()

# Platform-specific libs

Expand Down
Loading