feat(gx): add directxmath for MinGW

This commit is contained in:
phaneron 2024-09-07 13:54:54 -04:00
parent 0d09dee4b3
commit 3e77eb935a
51 changed files with 49251 additions and 12 deletions

View file

@ -6,24 +6,24 @@ file(GLOB GX_SOURCES
"texture/*.cpp"
)
if(WHOA_SYSTEM_WIN)
if (WHOA_SYSTEM_WIN)
file(GLOB D3D_SOURCES "d3d/*.cpp")
list(APPEND GX_SOURCES ${D3D_SOURCES})
endif()
endif ()
if(WHOA_SYSTEM_MAC)
if (WHOA_SYSTEM_MAC)
file(GLOB GLL_SOURCES "gll/*.cpp" "gll/*.mm")
set_source_files_properties(${GLL_SOURCES}
PROPERTIES COMPILE_FLAGS "-x objective-c++"
)
list(APPEND GX_SOURCES ${GLL_SOURCES})
endif()
endif ()
# Build OpenGL/SDL graphics device if enabled
if(WHOA_BUILD_GLSDL)
if (WHOA_BUILD_GLSDL)
file(GLOB GLSDL_SOURCES "glsdl/*.cpp")
list(APPEND GX_SOURCES ${GLSDL_SOURCES})
endif()
endif ()
add_library(gx STATIC ${GX_SOURCES})
@ -46,12 +46,20 @@ target_link_libraries(gx
tempest
)
if(WHOA_SYSTEM_WIN)
if (WHOA_SYSTEM_WIN)
target_link_libraries(gx
PRIVATE
d3d9.lib
)
endif()
# MSVC includes DirectXMath by default
if (NOT MSVC)
target_link_libraries(gx
PRIVATE
DirectXMath
)
endif ()
endif ()
# Link SDL2 and GLEW for GLSDL
if (WHOA_BUILD_GLSDL)
@ -60,12 +68,12 @@ if (WHOA_BUILD_GLSDL)
SDL2::SDL2-static
libglew_static
)
endif()
endif ()
if(WHOA_SYSTEM_MAC)
if (WHOA_SYSTEM_MAC)
target_link_libraries(gx
PRIVATE
"-framework AppKit"
"-framework OpenGL"
)
endif()
endif ()

View file

@ -4,7 +4,7 @@
#include "gx/texture/CGxTex.hpp"
#include "math/Utils.hpp"
#include <algorithm>
#include <directxmath.h>
#include <DirectXMath.h>
int32_t CGxDeviceD3d::s_clientAdjustWidth;
int32_t CGxDeviceD3d::s_clientAdjustHeight;