Skip to content

Commit

Permalink
sokol_app.h: fix a C++ vs C problem with the DXGI API
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Jul 24, 2018
1 parent 96d0c4a commit 5c68e66
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sokol_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -2930,7 +2930,11 @@ _SOKOL_PRIVATE void _sapp_d3d11_destroy_device_and_swapchain(void) {

_SOKOL_PRIVATE void _sapp_d3d11_create_default_render_target(void) {
HRESULT hr;
#ifdef __cplusplus
hr = IDXGISwapChain_GetBuffer(_sapp_dxgi_swap_chain, 0, IID_ID3D11Texture2D, (void**)&_sapp_d3d11_rt);
#else
hr = IDXGISwapChain_GetBuffer(_sapp_dxgi_swap_chain, 0, &IID_ID3D11Texture2D, (void**)&_sapp_d3d11_rt);
#endif
SOKOL_ASSERT(SUCCEEDED(hr) && _sapp_d3d11_rt);
hr = ID3D11Device_CreateRenderTargetView(_sapp_d3d11_device, (ID3D11Resource*)_sapp_d3d11_rt, NULL, &_sapp_d3d11_rtv);
SOKOL_ASSERT(SUCCEEDED(hr) && _sapp_d3d11_rtv);
Expand Down

0 comments on commit 5c68e66

Please sign in to comment.