diff options
| author | Andre Weissflog <floooh@gmail.com> | 2021-06-06 16:03:31 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2021-06-06 16:03:31 +0200 |
| commit | b3ffdf3e561fe157fa8a03f08e49d0278c3624fd (patch) | |
| tree | 7b2834f589678ded3747ba83d9117c4761d553bc | |
| parent | be081ef0487017d85e03cd8f526dace502551d9e (diff) | |
d3d11 backends: remove dxguid dependency
| -rw-r--r-- | sokol_app.h | 9 | ||||
| -rw-r--r-- | sokol_gfx.h | 1 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sokol_app.h b/sokol_app.h index 64ebf47b..6dacdd35 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -71,7 +71,7 @@ - on Windows with MINGW/MSYS2 gcc: compile with '-mwin32' so that _WIN32 is defined - link with the following libs: -lkernel32 -luser32 -lshell32 - additionally with the GL backend: -lgdi32 - - additionally with the D3D11 backend: -ld3d11 -ldxgi -dxguid + - additionally with the D3D11 backend: -ld3d11 -ldxgi On Linux, you also need to use the -pthread compiler and linker option, otherwise weird things will happen, see here for details: https://github.com/floooh/sokol/issues/376 @@ -1713,7 +1713,6 @@ inline void sapp_run(const sapp_desc& desc) { return sapp_run(&desc); } #if defined(SOKOL_D3D11) #pragma comment (lib, "dxgi") #pragma comment (lib, "d3d11") - #pragma comment (lib, "dxguid") #endif #if defined(SOKOL_D3D11) @@ -5333,6 +5332,8 @@ _SOKOL_PRIVATE void _sapp_win32_uwp_init_keytable(void) { #define _SAPP_SAFE_RELEASE(obj) if (obj) { _sapp_d3d11_Release(obj); obj=0; } +static const IID _sapp_IID_ID3D11Texture2D = { 0x6f15aaf2,0xd208,0x4e89,0x9a,0xb4,0x48,0x95,0x35,0xd3,0x4f,0x9c }; + static inline HRESULT _sapp_dxgi_GetBuffer(IDXGISwapChain* self, UINT Buffer, REFIID riid, void** ppSurface) { #if defined(__cplusplus) return self->GetBuffer(Buffer, riid, ppSurface); @@ -5449,9 +5450,9 @@ _SOKOL_PRIVATE void _sapp_d3d11_create_default_render_target(void) { /* view for the swapchain-created framebuffer */ #ifdef __cplusplus - hr = _sapp_dxgi_GetBuffer(_sapp.d3d11.swap_chain, 0, IID_ID3D11Texture2D, (void**)&_sapp.d3d11.rt); + hr = _sapp_dxgi_GetBuffer(_sapp.d3d11.swap_chain, 0, _sapp_IID_ID3D11Texture2D, (void**)&_sapp.d3d11.rt); #else - hr = _sapp_dxgi_GetBuffer(_sapp.d3d11.swap_chain, 0, &IID_ID3D11Texture2D, (void**)&_sapp.d3d11.rt); + hr = _sapp_dxgi_GetBuffer(_sapp.d3d11.swap_chain, 0, &_sapp_IID_ID3D11Texture2D, (void**)&_sapp.d3d11.rt); #endif SOKOL_ASSERT(SUCCEEDED(hr) && _sapp.d3d11.rt); hr = _sapp_d3d11_CreateRenderTargetView(_sapp.d3d11.device, (ID3D11Resource*)_sapp.d3d11.rt, NULL, &_sapp.d3d11.rtv); diff --git a/sokol_gfx.h b/sokol_gfx.h index fa6b6a65..cb6d7d55 100644 --- a/sokol_gfx.h +++ b/sokol_gfx.h @@ -2530,7 +2530,6 @@ inline int sg_append_buffer(sg_buffer buf_id, const sg_range& data) { return sg_ #pragma comment (lib, "user32") #pragma comment (lib, "dxgi") #pragma comment (lib, "d3d11") - #pragma comment (lib, "dxguid") #endif #endif #elif defined(SOKOL_METAL) |