mirror of
https://github.com/SFML/SFML.git
synced 2025-02-16 21:38:00 +08:00
Fixed compile errors in SensorImpl.mm and with EGL stuff on iOS
This commit is contained in:
parent
80431deef4
commit
03acb2ad9f
@ -23,13 +23,13 @@ set(SRC
|
|||||||
${SRCROOT}/Keyboard.cpp
|
${SRCROOT}/Keyboard.cpp
|
||||||
${INCROOT}/Mouse.hpp
|
${INCROOT}/Mouse.hpp
|
||||||
${SRCROOT}/Mouse.cpp
|
${SRCROOT}/Mouse.cpp
|
||||||
${INCROOT}/Touch.hpp
|
${INCROOT}/Touch.hpp
|
||||||
${SRCROOT}/Touch.cpp
|
${SRCROOT}/Touch.cpp
|
||||||
${INCROOT}/Sensor.hpp
|
${INCROOT}/Sensor.hpp
|
||||||
${SRCROOT}/Sensor.cpp
|
${SRCROOT}/Sensor.cpp
|
||||||
${SRCROOT}/SensorImpl.hpp
|
${SRCROOT}/SensorImpl.hpp
|
||||||
${SRCROOT}/SensorManager.cpp
|
${SRCROOT}/SensorManager.cpp
|
||||||
${SRCROOT}/SensorManager.hpp
|
${SRCROOT}/SensorManager.hpp
|
||||||
${SRCROOT}/VideoMode.cpp
|
${SRCROOT}/VideoMode.cpp
|
||||||
${INCROOT}/VideoMode.hpp
|
${INCROOT}/VideoMode.hpp
|
||||||
${SRCROOT}/VideoModeImpl.hpp
|
${SRCROOT}/VideoModeImpl.hpp
|
||||||
@ -40,7 +40,7 @@ set(SRC
|
|||||||
${SRCROOT}/WindowImpl.hpp
|
${SRCROOT}/WindowImpl.hpp
|
||||||
${INCROOT}/WindowStyle.hpp
|
${INCROOT}/WindowStyle.hpp
|
||||||
)
|
)
|
||||||
if(SFML_OPENGL_ES)
|
if(SFML_OPENGL_ES AND NOT SFML_OS_IOS)
|
||||||
list(APPEND SRC ${SRCROOT}/EGLCheck.cpp)
|
list(APPEND SRC ${SRCROOT}/EGLCheck.cpp)
|
||||||
list(APPEND SRC ${SRCROOT}/EGLCheck.hpp)
|
list(APPEND SRC ${SRCROOT}/EGLCheck.hpp)
|
||||||
list(APPEND SRC ${SRCROOT}/EglContext.cpp)
|
list(APPEND SRC ${SRCROOT}/EglContext.cpp)
|
||||||
@ -86,7 +86,7 @@ elseif(SFML_OS_LINUX OR SFML_OS_FREEBSD)
|
|||||||
${SRCROOT}/Unix/GlxContext.hpp
|
${SRCROOT}/Unix/GlxContext.hpp
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
if(SFML_OS_LINUX)
|
if(SFML_OS_LINUX)
|
||||||
set(PLATFORM_SRC
|
set(PLATFORM_SRC
|
||||||
${PLATFORM_SRC}
|
${PLATFORM_SRC}
|
||||||
${SRCROOT}/Unix/JoystickImpl.cpp
|
${SRCROOT}/Unix/JoystickImpl.cpp
|
||||||
@ -98,9 +98,9 @@ elseif(SFML_OS_LINUX OR SFML_OS_FREEBSD)
|
|||||||
${SRCROOT}/FreeBSD/JoystickImpl.cpp
|
${SRCROOT}/FreeBSD/JoystickImpl.cpp
|
||||||
${SRCROOT}/FreeBSD/JoystickImpl.hpp
|
${SRCROOT}/FreeBSD/JoystickImpl.hpp
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
source_group("unix" FILES ${PLATFORM_SRC})
|
source_group("unix" FILES ${PLATFORM_SRC})
|
||||||
elseif(SFML_OS_MACOSX)
|
elseif(SFML_OS_MACOSX)
|
||||||
set(PLATFORM_SRC
|
set(PLATFORM_SRC
|
||||||
${SRCROOT}/OSX/cpp_objc_conversion.h
|
${SRCROOT}/OSX/cpp_objc_conversion.h
|
||||||
${SRCROOT}/OSX/cpp_objc_conversion.mm
|
${SRCROOT}/OSX/cpp_objc_conversion.mm
|
||||||
@ -178,7 +178,7 @@ elseif(SFML_OS_ANDROID)
|
|||||||
)
|
)
|
||||||
source_group("android" FILES ${PLATFORM_SRC})
|
source_group("android" FILES ${PLATFORM_SRC})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# find external libraries
|
# find external libraries
|
||||||
if(SFML_OS_LINUX OR SFML_OS_FREEBSD)
|
if(SFML_OS_LINUX OR SFML_OS_FREEBSD)
|
||||||
find_package(X11 REQUIRED)
|
find_package(X11 REQUIRED)
|
||||||
@ -186,7 +186,7 @@ if(SFML_OS_LINUX OR SFML_OS_FREEBSD)
|
|||||||
message(FATAL_ERROR "Xrandr library not found")
|
message(FATAL_ERROR "Xrandr library not found")
|
||||||
endif()
|
endif()
|
||||||
include_directories(${X11_INCLUDE_DIR})
|
include_directories(${X11_INCLUDE_DIR})
|
||||||
endif()
|
endif()
|
||||||
if(NOT SFML_OPENGL_ES)
|
if(NOT SFML_OPENGL_ES)
|
||||||
find_package(OpenGL REQUIRED)
|
find_package(OpenGL REQUIRED)
|
||||||
include_directories(${OPENGL_INCLUDE_DIR})
|
include_directories(${OPENGL_INCLUDE_DIR})
|
||||||
@ -208,21 +208,21 @@ if(SFML_OPENGL_ES AND SFML_OS_LINUX)
|
|||||||
find_package(GLES REQUIRED)
|
find_package(GLES REQUIRED)
|
||||||
include_directories(${EGL_INCLUDE_DIR} ${GLES_INCLUDE_DIR})
|
include_directories(${EGL_INCLUDE_DIR} ${GLES_INCLUDE_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# build the list of external libraries to link
|
# build the list of external libraries to link
|
||||||
if(SFML_OS_WINDOWS)
|
if(SFML_OS_WINDOWS)
|
||||||
list(APPEND WINDOW_EXT_LIBS winmm gdi32)
|
list(APPEND WINDOW_EXT_LIBS winmm gdi32)
|
||||||
elseif(SFML_OS_LINUX OR SFML_OS_FREEBSD)
|
elseif(SFML_OS_LINUX OR SFML_OS_FREEBSD)
|
||||||
list(APPEND WINDOW_EXT_LIBS ${X11_X11_LIB} ${X11_Xrandr_LIB} ${UDEV_LIBRARIES})
|
list(APPEND WINDOW_EXT_LIBS ${X11_X11_LIB} ${X11_Xrandr_LIB} ${UDEV_LIBRARIES})
|
||||||
if(SFML_OS_FREEBSD)
|
if(SFML_OS_FREEBSD)
|
||||||
list(APPEND WINDOW_EXT_LIBS usbhid)
|
list(APPEND WINDOW_EXT_LIBS usbhid)
|
||||||
endif()
|
endif()
|
||||||
elseif(SFML_OS_MACOSX)
|
elseif(SFML_OS_MACOSX)
|
||||||
list(APPEND WINDOW_EXT_LIBS "-framework Foundation -framework AppKit -framework IOKit -framework Carbon")
|
list(APPEND WINDOW_EXT_LIBS "-framework Foundation -framework AppKit -framework IOKit -framework Carbon")
|
||||||
elseif(SFML_OS_IOS)
|
elseif(SFML_OS_IOS)
|
||||||
list(APPEND WINDOW_EXT_LIBS "-framework Foundation -framework UIKit -framework CoreGraphics -framework QuartzCore -framework CoreMotion")
|
list(APPEND WINDOW_EXT_LIBS "-framework Foundation -framework UIKit -framework CoreGraphics -framework QuartzCore -framework CoreMotion")
|
||||||
elseif(SFML_OS_ANDROID)
|
elseif(SFML_OS_ANDROID)
|
||||||
list(APPEND WINDOW_EXT_LIBS "-landroid")
|
list(APPEND WINDOW_EXT_LIBS "-landroid")
|
||||||
endif()
|
endif()
|
||||||
if(SFML_OPENGL_ES)
|
if(SFML_OPENGL_ES)
|
||||||
if(SFML_OS_LINUX)
|
if(SFML_OS_LINUX)
|
||||||
|
@ -96,13 +96,6 @@ public :
|
|||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
JoystickState update();
|
JoystickState update();
|
||||||
|
|
||||||
private :
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
|
||||||
// Member data
|
|
||||||
////////////////////////////////////////////////////////////
|
|
||||||
int m_index; ///< Index of the joystick
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace priv
|
} // namespace priv
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
// Headers
|
// Headers
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
#include <SFML/Window/SensorImpl.hpp>
|
#include <SFML/Window/SensorImpl.hpp>
|
||||||
|
#include <SFML/Window/iOS/SFAppDelegate.hpp>
|
||||||
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
@ -186,7 +187,7 @@ void SensorImpl::setEnabled(bool enabled)
|
|||||||
if (enabled == m_enabled)
|
if (enabled == m_enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (index)
|
switch (m_sensor)
|
||||||
{
|
{
|
||||||
case Sensor::Accelerometer:
|
case Sensor::Accelerometer:
|
||||||
if (enabled)
|
if (enabled)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user