Skip to content

Commit

Permalink
Merge pull request #106 from qudix/upstream-po3-dev-pr
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
powerof3 authored Feb 28, 2024
2 parents 6510df4 + 1b66eaa commit 9a95e69
Show file tree
Hide file tree
Showing 21 changed files with 550 additions and 47 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ target_link_libraries(
spdlog::spdlog
Advapi32.lib
D3D11.lib
d3dcompiler.lib
Dbghelp.lib
DXGI.lib
Ole32.lib
Expand Down
26 changes: 1 addition & 25 deletions include/REX/W32/BASE.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace REX::W32
using HMONITOR = struct HMONITOR__*;
using HPALETTE = struct HPALETTE__*;
using HPEN = struct HPEN__*;
using HRESULT = std::int32_t;
using HSTRING = struct HSTRING__*;
using HWND = struct HWND__*;

Expand Down Expand Up @@ -86,31 +87,6 @@ namespace REX::W32
using IID = GUID;
}

namespace REX::W32
{
struct HRESULT
{
constexpr HRESULT() noexcept = default;

constexpr HRESULT(const std::int32_t a_hr) noexcept :
value(a_hr)
{}

constexpr operator bool() const noexcept
{
return value >= 0;
}

constexpr operator std::int32_t() const noexcept
{
return value;
}

std::int32_t value;
};
static_assert(sizeof(HRESULT) == 0x4);
}

namespace REX::W32
{
struct POINT
Expand Down
4 changes: 2 additions & 2 deletions include/REX/W32/COM.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "BASE.h"
#include "REX/W32/BASE.h"

namespace REX::W32
{
Expand All @@ -14,7 +14,7 @@ namespace REX::W32
template <class T>
HRESULT QueryInterface(T** a_object)
{
return QueryInterface(__uuidof(T), static_cast<void**>(a_object));
return QueryInterface(*reinterpret_cast<const IID*>(&__uuidof(T)), static_cast<void**>(a_object));
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion include/REX/W32/COMPTR.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "BASE.h"
#include "REX/W32/BASE.h"

namespace REX::W32
{
Expand Down
2 changes: 1 addition & 1 deletion include/REX/W32/D3D.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "DXGI.h"
#include "REX/W32/DXGI.h"

namespace REX::W32
{
Expand Down
528 changes: 527 additions & 1 deletion include/REX/W32/D3D11.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion include/REX/W32/D3D11_1.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "D3D11.h"
#include "REX/W32/D3D11.h"

namespace REX::W32
{
Expand Down
2 changes: 1 addition & 1 deletion include/REX/W32/D3D11_2.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "D3D11_1.h"
#include "REX/W32/D3D11_1.h"

namespace REX::W32
{
Expand Down
2 changes: 1 addition & 1 deletion include/REX/W32/D3D11_3.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "D3D11_2.h"
#include "REX/W32/D3D11_2.h"

namespace REX::W32
{
Expand Down
4 changes: 2 additions & 2 deletions include/REX/W32/D3D11_4.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "D3D11_3.h"
#include "DXGI_5.h"
#include "REX/W32/D3D11_3.h"
#include "REX/W32/DXGI_5.h"

namespace REX::W32
{
Expand Down
2 changes: 1 addition & 1 deletion include/REX/W32/D3DCOMPILER.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "D3D.h"
#include "REX/W32/D3D.h"

namespace REX::W32
{
Expand Down
4 changes: 2 additions & 2 deletions include/REX/W32/DINPUT.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "COM.h"
#include "D3D.h"
#include "REX/W32/COM.h"
#include "REX/W32/D3D.h"

namespace REX::W32
{
Expand Down
2 changes: 1 addition & 1 deletion include/REX/W32/DXGI.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "COM.h"
#include "REX/W32/COM.h"

namespace REX::W32
{
Expand Down
2 changes: 1 addition & 1 deletion include/REX/W32/DXGI_2.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "DXGI.h"
#include "REX/W32/DXGI.h"

namespace REX::W32
{
Expand Down
2 changes: 1 addition & 1 deletion include/REX/W32/DXGI_3.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "DXGI_2.h"
#include "REX/W32/DXGI_2.h"

namespace REX::W32
{
Expand Down
2 changes: 1 addition & 1 deletion include/REX/W32/DXGI_4.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "DXGI_3.h"
#include "REX/W32/DXGI_3.h"

namespace REX::W32
{
Expand Down
2 changes: 1 addition & 1 deletion include/REX/W32/DXGI_5.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "DXGI_4.h"
#include "REX/W32/DXGI_4.h"

namespace REX::W32
{
Expand Down
2 changes: 1 addition & 1 deletion include/REX/W32/DXGI_6.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "DXGI_5.h"
#include "REX/W32/DXGI_5.h"

namespace REX::W32
{
Expand Down
2 changes: 1 addition & 1 deletion src/REX/W32/D3D11.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "D3D11.h"
#include "REX/W32/D3D11.h"

REX_W32_IMPORT(std::int32_t, D3D11CreateDevice, REX::W32::IDXGIAdapter*, REX::W32::D3D_DRIVER_TYPE, REX::W32::HMODULE, std::uint32_t, const REX::W32::D3D_FEATURE_LEVEL*, std::uint32_t, std::uint32_t, REX::W32::ID3D11Device**, REX::W32::D3D_FEATURE_LEVEL*, REX::W32::ID3D11DeviceContext**);
REX_W32_IMPORT(std::int32_t, D3D11CreateDeviceAndSwapChain, REX::W32::IDXGIAdapter*, REX::W32::D3D_DRIVER_TYPE, REX::W32::HMODULE, std::uint32_t, const REX::W32::D3D_FEATURE_LEVEL*, std::uint32_t, std::uint32_t, const REX::W32::DXGI_SWAP_CHAIN_DESC*, REX::W32::IDXGISwapChain**, REX::W32::ID3D11Device**, REX::W32::D3D_FEATURE_LEVEL*, REX::W32::ID3D11DeviceContext**);
Expand Down
2 changes: 1 addition & 1 deletion src/REX/W32/D3DCOMPILER.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "D3DCOMPILER.h"
#include "REX/W32/D3DCOMPILER.h"

REX_W32_IMPORT(std::int32_t, D3DCompile, const void*, std::size_t, const char*, const REX::W32::D3D_SHADER_MACRO*, REX::W32::ID3DInclude*, const char*, const char*, std::uint32_t, std::uint32_t, REX::W32::ID3DBlob**, REX::W32::ID3DBlob**);
REX_W32_IMPORT(std::int32_t, D3DCompile2, const void*, std::size_t, const char*, const REX::W32::D3D_SHADER_MACRO*, REX::W32::ID3DInclude*, const char*, const char*, std::uint32_t, std::uint32_t, std::uint32_t, const void*, std::size_t, REX::W32::ID3DBlob**, REX::W32::ID3DBlob**);
Expand Down
2 changes: 1 addition & 1 deletion src/REX/W32/DXGI.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "DXGI.h"
#include "REX/W32/DXGI.h"

REX_W32_IMPORT(std::int32_t, CreateDXGIFactory, const IID&, void**);
REX_W32_IMPORT(std::int32_t, CreateDXGIFactory1, const IID&, void**);
Expand Down

0 comments on commit 9a95e69

Please sign in to comment.