diff --git a/CMakeLists.txt b/CMakeLists.txt index b3a52ac..b6fc97d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,7 +76,7 @@ elseif(WIN32) message(STATUS "Enabling Vulkan support") list(GET VULKAN_SDK_DIRS 0 VULKAN_SDK_DIR) include_directories("${VULKAN_SDK_DIR}/Include") - list(APPEND _BOO_SYS_DEFINES -DBOO_HAS_VULKAN=1) + list(APPEND _BOO_SYS_DEFINES -DBOO_HAS_VULKAN=1 -DVK_USE_PLATFORM_WIN32_KHR=1) list(APPEND _BOO_SYS_INCLUDES "${VULKAN_SDK_DIR}/Include") list(APPEND PLAT_SRCS lib/graphicsdev/Vulkan.cpp lib/graphicsdev/VulkanDispatchTable.cpp) @@ -204,7 +204,7 @@ else(NOT GEKKO) lib/inputdev/HIDDeviceUdev.cpp lib/graphicsdev/Vulkan.cpp lib/graphicsdev/VulkanDispatchTable.cpp) - list(APPEND _BOO_SYS_DEFINES -DBOO_HAS_VULKAN=1) + list(APPEND _BOO_SYS_DEFINES -DBOO_HAS_VULKAN=1 -DVK_USE_PLATFORM_XCB_KHR=1) list(APPEND _BOO_SYS_LIBS xcb X11-xcb dl udev) else() list(APPEND PLAT_SRCS diff --git a/include/boo/graphicsdev/VulkanDispatchTable.hpp b/include/boo/graphicsdev/VulkanDispatchTable.hpp index 88ec0f4..78ef317 100644 --- a/include/boo/graphicsdev/VulkanDispatchTable.hpp +++ b/include/boo/graphicsdev/VulkanDispatchTable.hpp @@ -2,12 +2,6 @@ #ifndef HELPERSDISPATCHTABLE_H #define HELPERSDISPATCHTABLE_H -#ifdef _WIN32 -#define VK_USE_PLATFORM_WIN32_KHR -#else -#define VK_USE_PLATFORM_XCB_KHR -#endif - #include namespace vk { diff --git a/lib/inputdev/DualshockPad.cpp b/lib/inputdev/DualshockPad.cpp index 45adfdd..22509b6 100644 --- a/lib/inputdev/DualshockPad.cpp +++ b/lib/inputdev/DualshockPad.cpp @@ -13,7 +13,11 @@ static inline uint16_t bswap16(uint16_t val) {return __builtin_bswap16(val); } static inline uint16_t bswap16(uint16_t val) {return __builtin_byteswap(val);} #endif -#define RAD_TO_DEG (180.0/M_PI) +#ifndef M_PIF +#define M_PIF 3.14159265358979323846f /* pi */ +#endif + +#define RAD_TO_DEG (180.f/M_PIF) namespace boo { @@ -91,8 +95,8 @@ void DualshockPad::receivedHIDReport(const uint8_t* data, size_t length, HIDRepo float accXval = -((double)state.m_accelerometer[0] - zeroG); float accYval = -((double)state.m_accelerometer[1] - zeroG); float accZval = -((double)state.m_accelerometer[2] - zeroG); - state.accPitch = (atan2(accYval, accZval) + M_PI) * RAD_TO_DEG; - state.accYaw = (atan2(accXval, accZval) + M_PI) * RAD_TO_DEG; + state.accPitch = (atan2(accYval, accZval) + M_PIF) * RAD_TO_DEG; + state.accYaw = (atan2(accXval, accZval) + M_PIF) * RAD_TO_DEG; state.gyroZ = (state.m_gyrometerZ / 1023.f); {