Skip to content

Commit 64af60f

Browse files
committed
Fix compilation with MinGW
1 parent b164e49 commit 64af60f

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

premake5.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ function findlibs()
134134
else
135135
links { "SDL2" }
136136
end
137-
filter { "platforms:win-amd64-gl3" }
137+
filter { "platforms:win-amd64-gl3", "action:vs*" }
138138
libdirs { path.join(_OPTIONS["glfwdir64"], "lib-vc2015") }
139139
libdirs { path.join(_OPTIONS["sdl2dir"], "lib/x64") }
140-
filter { "platforms:win-x86-gl3" }
140+
filter { "platforms:win-x86-gl3", "action:vs*" }
141141
libdirs { path.join(_OPTIONS["glfwdir32"], "lib-vc2015") }
142142
libdirs { path.join(_OPTIONS["sdl2dir"], "lib/x86") }
143143
filter { "platforms:win*gl3" }
@@ -149,8 +149,6 @@ function findlibs()
149149
end
150150
filter { "platforms:*d3d9" }
151151
links { "gdi32", "d3d9" }
152-
filter { "platforms:*d3d9", "action:vs*" }
153-
links { "Xinput9_1_0" }
154152
filter {}
155153
end
156154

skeleton/imgui/ImGuizmo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#endif
2727
#include "imgui_internal.h"
2828
#include "ImGuizmo.h"
29-
#if !defined(_WIN32)
29+
#if !defined(_WIN32) || (defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR))
3030
#define _malloca(x) alloca(x)
3131
#define _freea(x)
3232
#else

src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ elseif(LIBRW_PLATFORM_D3D9)
188188
target_link_libraries(librw
189189
PRIVATE
190190
d3d9
191-
xinput
192191
)
193192
endif()
194193

src/d3d/rwd3d.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
#ifdef RW_D3D9
22
#ifdef WITH_D3D
33
#include <d3d9.h>
4+
#else
5+
typedef struct IDirect3DDevice9 IDirect3DDevice9;
46
#endif
57
#endif
68

79
namespace rw {
810

911
#ifdef RW_D3D9
1012

11-
#ifdef _WINDOWS_
13+
#if defined(_WINDOWS_) || defined(_WINDEF_H)
1214
struct EngineOpenParams
1315
{
1416
HWND window;
@@ -19,10 +21,7 @@ struct EngineOpenParams
1921
uint32 please_include_windows_h;
2022
};
2123
#endif
22-
#else
23-
#ifdef _D3D9_H_
24-
#error "please don't include d3d9.h for non-d3d9 platforms"
25-
#endif
24+
2625
#endif
2726

2827
namespace d3d {
@@ -32,10 +31,7 @@ extern bool32 isP8supported;
3231
extern Device renderdevice;
3332

3433
#ifdef RW_D3D9
35-
#ifdef _D3D9_H_
3634
extern IDirect3DDevice9 *d3ddevice;
37-
void setD3dMaterial(D3DMATERIAL9 *mat9);
38-
#endif
3935

4036
#define COLOR_ARGB(a, r, g, b) ((rw::uint32)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff)))
4137

0 commit comments

Comments
 (0)