Skip to content

Commit d2d8c84

Browse files
committed
Cinder code updates for removal of <Win10
1 parent 57b41f1 commit d2d8c84

File tree

5 files changed

+4
-85
lines changed

5 files changed

+4
-85
lines changed

include/cinder/audio/msw/ContextWasapi.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#pragma once
2525

2626
#include "cinder/Cinder.h"
27-
#if ( _WIN32_WINNT >= 0x0600 ) // requires Windows Vista+
2827

2928
#include "cinder/audio/Context.h"
3029

@@ -95,5 +94,3 @@ class WasapiExc : public AudioExc {
9594
};
9695

9796
} } } // namespace cinder::audio::msw
98-
99-
#endif // ( _WIN32_WINNT >= 0x0600 )

include/cinder/audio/msw/DeviceManagerWasapi.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#pragma once
2525

2626
#include "cinder/Cinder.h"
27-
#if ( _WIN32_WINNT >= _WIN32_WINNT_VISTA ) // requires Windows Vista+
2827

2928
#include "cinder/audio/Device.h"
3029

@@ -77,6 +76,4 @@ class DeviceManagerWasapi : public DeviceManager {
7776
std::unique_ptr<Impl> mImpl;
7877
};
7978

80-
} } } // namespace cinder::audio::msw
81-
82-
#endif // #if ( _WIN32_WINNT >= _WIN32_WINNT_VISTA ) // requires Windows Vista+
79+
} } } // namespace cinder::audio::msw

src/cinder/ImageTargetFileWic.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
#include <map>
2929
#include <set>
3030

31-
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
32-
#include <D2D1.h>
33-
#endif
31+
#include <D2D1.h>
3432
#include <wincodec.h>
3533
#include <wincodecsdk.h>
3634
#pragma comment( lib, "WindowsCodecs.lib" )

src/cinder/app/msw/RendererImplDx.cpp

Lines changed: 2 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// may be used to endorse or promote products derived from this software
1818
// without specific prior written permission.
1919
//
20-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES,
20+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES,
2121
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
2222
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
2323
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
@@ -316,24 +316,15 @@ void RendererImplDx::swapBuffers() const
316316
parameters.pScrollOffset = nullptr;
317317

318318
HRESULT hr;
319-
#if ( _WIN32_WINNT >= 0x0602 )
320319
if( mVsyncEnable )
321320
hr = mSwapChain->Present1( 1, 0, &parameters );
322321
else
323322
hr = mSwapChain->Present1( 0, 0, &parameters );
324-
#else
325-
if( mVsyncEnable )
326-
hr = mSwapChain->Present( 1, 0 );
327-
else
328-
hr = mSwapChain->Present( 0, 0 );
329-
#endif
330323
//handle device lost
331324
if(hr == DXGI_ERROR_DEVICE_REMOVED)
332325
const_cast<RendererImplDx*>(this)->handleLostDevice();
333-
#if ( _WIN32_WINNT >= 0x0602 )
334326
mDeviceContext->DiscardView( mMainFramebuffer );
335327
mDeviceContext->DiscardView( mDepthStencilView );
336-
#endif
337328
}
338329

339330
void RendererImplDx::makeCurrentContext()
@@ -597,10 +588,7 @@ bool RendererImplDx::createDevice( UINT createDeviceFlags )
597588
{
598589
D3D_FEATURE_LEVEL featureLevels[] =
599590
{
600-
#if (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/)
601-
// This requires Windows 8.
602591
D3D_FEATURE_LEVEL_11_1,
603-
#endif
604592
D3D_FEATURE_LEVEL_11_0,
605593
D3D_FEATURE_LEVEL_10_1,
606594
D3D_FEATURE_LEVEL_10_0,
@@ -625,19 +613,11 @@ bool RendererImplDx::createDevice( UINT createDeviceFlags )
625613
);
626614

627615
if( hr == S_OK ) {
628-
#if ( _WIN32_WINNT >= 0x0602 )
629616
hr = device->QueryInterface(__uuidof(ID3D11Device1), (void**)&md3dDevice);
630-
#else
631-
hr = device->QueryInterface(__uuidof(ID3D11Device), (void**)&md3dDevice);
632-
#endif
633617
}
634618

635619
if( hr == S_OK ) {
636-
#if ( _WIN32_WINNT >= 0x0602 )
637620
hr = context->QueryInterface(__uuidof(ID3D11DeviceContext1), (void**)&mDeviceContext);
638-
#else
639-
hr = context->QueryInterface(__uuidof(ID3D11DeviceContext), (void**)&mDeviceContext);
640-
#endif
641621
}
642622

643623
if( context )
@@ -689,7 +669,6 @@ bool RendererImplDx::createFramebufferResources()
689669
if( hr != S_OK )
690670
return false;
691671

692-
#if ( _WIN32_WINNT >= 0x0602 )
693672
IDXGIFactory2 *dxgiFactory;
694673
hr = dxgiAdapter->GetParent(__uuidof(IDXGIFactory2), (void**)&dxgiFactory);
695674
if( hr != S_OK )
@@ -704,57 +683,11 @@ bool RendererImplDx::createFramebufferResources()
704683
swapChainDesc.SampleDesc.Quality = 0;
705684
swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
706685
swapChainDesc.BufferCount = 2; // Use double-buffering to minimize latency.
707-
708-
// Check to see if the OS is Windows 8 or later. If it's not, then that means
709-
// compiling/running on Windows 7 SP1. We use this to set the appropriate
710-
// flags for Windows7 SP 1's DirectX 11.1 support.
711-
//
712-
OSVERSIONINFOEX osver;
713-
ZeroMemory( &osver, sizeof(OSVERSIONINFOEX) );
714-
osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
715-
GetVersionEx( (OSVERSIONINFO*)&osver );
716-
bool isWin8 = (osver.dwMajorVersion >= 6) && (osver.dwMinorVersion >= 2);
717-
718-
if( isWin8 ) {
719-
swapChainDesc.Scaling = DXGI_SCALING_NONE;
720-
}
721-
else {
722-
//
723-
// Win7 doesn't support DXGI_SCALING_NONE:
724-
// http://msdn.microsoft.com/en-us/library/windows/desktop/hh404557(v=vs.85).aspx
725-
//
726-
swapChainDesc.Scaling = DXGI_SCALING_STRETCH;
727-
}
728-
686+
swapChainDesc.Scaling = DXGI_SCALING_NONE;
729687
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; // All Windows Store apps must use this SwapEffect.
730688
swapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH;
731689

732690
hr = dxgiFactory->CreateSwapChainForHwnd( md3dDevice, mWnd, &swapChainDesc, NULL, NULL, &mSwapChain );
733-
#else
734-
IDXGIFactory1 *dxgiFactory;
735-
hr = dxgiAdapter->GetParent(__uuidof(IDXGIFactory1), (void**)&dxgiFactory);
736-
if( hr != S_OK )
737-
return false;
738-
739-
DXGI_SWAP_CHAIN_DESC swapChainDesc = {0};
740-
swapChainDesc.BufferDesc.Width = static_cast<UINT>(width); // Match the size of the window.
741-
swapChainDesc.BufferDesc.Height = static_cast<UINT>(height);
742-
swapChainDesc.BufferDesc.RefreshRate.Numerator = 60;
743-
swapChainDesc.BufferDesc.RefreshRate.Denominator = 1;
744-
swapChainDesc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; // This is the most common swap chain format.
745-
swapChainDesc.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;
746-
swapChainDesc.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED;
747-
swapChainDesc.SampleDesc.Count = 1; // Don't use multi-sampling.
748-
swapChainDesc.SampleDesc.Quality = 0;
749-
swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
750-
swapChainDesc.BufferCount = 2; // Use double-buffering to minimize latency.
751-
swapChainDesc.OutputWindow = mWnd;
752-
swapChainDesc.Windowed = TRUE;
753-
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
754-
swapChainDesc.Flags = 0;
755-
756-
hr = dxgiFactory->CreateSwapChain( md3dDevice, &swapChainDesc, &mSwapChain );
757-
#endif
758691
if( hr != S_OK )
759692
return false;
760693
hr = dxgiDevice->SetMaximumFrameLatency(1);

src/cinder/audio/Context.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,7 @@ Context* Context::master()
8787
#if defined( CINDER_COCOA )
8888
sMasterContext.reset( new cocoa::ContextAudioUnit() );
8989
#elif defined( CINDER_MSW )
90-
#if( _WIN32_WINNT >= 0x0600 ) // requires Windows Vista+
9190
sMasterContext.reset( new msw::ContextWasapi() );
92-
#else
93-
sMasterContext.reset( new msw::ContextXAudio() );
94-
#endif
9591
#elif defined( CINDER_ANDROID )
9692
sMasterContext.reset( new android::ContextOpenSl() );
9793
#elif defined( CINDER_LINUX )
@@ -111,9 +107,7 @@ DeviceManager* Context::deviceManager()
111107
#elif defined( CINDER_COCOA_TOUCH )
112108
sDeviceManager.reset( new cocoa::DeviceManagerAudioSession() );
113109
#elif defined( CINDER_MSW )
114-
#if( _WIN32_WINNT > 0x0600 ) // requires Windows Vista+
115110
sDeviceManager.reset( new msw::DeviceManagerWasapi() );
116-
#endif
117111
#elif defined( CINDER_ANDROID )
118112
sDeviceManager.reset( new android::DeviceManagerOpenSl() );
119113
#elif defined( CINDER_LINUX )

0 commit comments

Comments
 (0)