Skip to content

Commit

Permalink
Fix compilation with MinGW
Browse files Browse the repository at this point in the history
  • Loading branch information
ccawley2011 committed Jul 5, 2021
1 parent b2ceadc commit 3711431
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
6 changes: 2 additions & 4 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ function findlibs()
else
links { "SDL2" }
end
filter { "platforms:win-amd64-gl3" }
filter { "platforms:win-amd64-gl3", "action:vs*" }
libdirs { path.join(_OPTIONS["glfwdir64"], "lib-vc2015") }
libdirs { path.join(_OPTIONS["sdl2dir"], "lib/x64") }
filter { "platforms:win-x86-gl3" }
filter { "platforms:win-x86-gl3", "action:vs*" }
libdirs { path.join(_OPTIONS["glfwdir32"], "lib-vc2015") }
libdirs { path.join(_OPTIONS["sdl2dir"], "lib/x86") }
filter { "platforms:win*gl3" }
Expand All @@ -149,8 +149,6 @@ function findlibs()
end
filter { "platforms:*d3d9" }
links { "gdi32", "d3d9" }
filter { "platforms:*d3d9", "action:vs*" }
links { "Xinput9_1_0" }
filter {}
end

Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ elseif(LIBRW_PLATFORM_D3D9)
target_link_libraries(librw
PRIVATE
d3d9
xinput
)
endif()

Expand Down
12 changes: 4 additions & 8 deletions src/d3d/rwd3d.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#ifdef RW_D3D9
#ifdef WITH_D3D
#include <d3d9.h>
#else
typedef struct IDirect3DDevice9 IDirect3DDevice9;
#endif
#endif

namespace rw {

#ifdef RW_D3D9

#ifdef _WINDOWS_
#if defined(_WINDOWS_) || defined(_WINDEF_H)
struct EngineOpenParams
{
HWND window;
Expand All @@ -19,10 +21,7 @@ struct EngineOpenParams
uint32 please_include_windows_h;
};
#endif
#else
#ifdef _D3D9_H_
#error "please don't include d3d9.h for non-d3d9 platforms"
#endif

#endif

namespace d3d {
Expand All @@ -32,10 +31,7 @@ extern bool32 isP8supported;
extern Device renderdevice;

#ifdef RW_D3D9
#ifdef _D3D9_H_
extern IDirect3DDevice9 *d3ddevice;
void setD3dMaterial(D3DMATERIAL9 *mat9);
#endif

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

Expand Down

0 comments on commit 3711431

Please sign in to comment.