vcpkg/ports/dxut/dll.patch
2016-10-20 16:50:35 +08:00

835 lines
49 KiB
Diff

diff --git a/Core/DDSTextureLoader.h b/Core/DDSTextureLoader.h
index 122df9f..8af6c62 100644
--- a/Core/DDSTextureLoader.h
+++ b/Core/DDSTextureLoader.h
@@ -23,6 +23,11 @@
#include <d3d11_1.h>
#include <stdint.h>
+#ifdef DXUT_EXPORT
+ #define DXUT_API __declspec(dllexport)
+#else
+ #define DXUT_API __declspec(dllimport)
+#endif
namespace DirectX
{
@@ -34,9 +39,9 @@ namespace DirectX
DDS_ALPHA_MODE_OPAQUE = 3,
DDS_ALPHA_MODE_CUSTOM = 4,
};
-
+
// Standard version
- HRESULT CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice,
+ HRESULT DXUT_API CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice,
_In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
_In_ size_t ddsDataSize,
_Outptr_opt_ ID3D11Resource** texture,
@@ -45,7 +50,7 @@ namespace DirectX
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr
);
- HRESULT CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice,
+ HRESULT DXUT_API CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice,
_In_z_ const wchar_t* szFileName,
_Outptr_opt_ ID3D11Resource** texture,
_Outptr_opt_ ID3D11ShaderResourceView** textureView,
@@ -54,7 +59,7 @@ namespace DirectX
);
// Standard version with optional auto-gen mipmap support
- HRESULT CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice,
+ HRESULT DXUT_API CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice,
_In_opt_ ID3D11DeviceContext* d3dContext,
_In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
_In_ size_t ddsDataSize,
@@ -64,7 +69,7 @@ namespace DirectX
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr
);
- HRESULT CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice,
+ HRESULT DXUT_API CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice,
_In_opt_ ID3D11DeviceContext* d3dContext,
_In_z_ const wchar_t* szFileName,
_Outptr_opt_ ID3D11Resource** texture,
@@ -74,7 +79,7 @@ namespace DirectX
);
// Extended version
- HRESULT CreateDDSTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice,
+ HRESULT DXUT_API CreateDDSTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice,
_In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
_In_ size_t ddsDataSize,
_In_ size_t maxsize,
@@ -88,7 +93,7 @@ namespace DirectX
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr
);
- HRESULT CreateDDSTextureFromFileEx( _In_ ID3D11Device* d3dDevice,
+ HRESULT DXUT_API CreateDDSTextureFromFileEx( _In_ ID3D11Device* d3dDevice,
_In_z_ const wchar_t* szFileName,
_In_ size_t maxsize,
_In_ D3D11_USAGE usage,
@@ -102,7 +107,7 @@ namespace DirectX
);
// Extended version with optional auto-gen mipmap support
- HRESULT CreateDDSTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice,
+ HRESULT DXUT_API CreateDDSTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice,
_In_opt_ ID3D11DeviceContext* d3dContext,
_In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
_In_ size_t ddsDataSize,
@@ -117,7 +122,7 @@ namespace DirectX
_Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr
);
- HRESULT CreateDDSTextureFromFileEx( _In_ ID3D11Device* d3dDevice,
+ HRESULT DXUT_API CreateDDSTextureFromFileEx( _In_ ID3D11Device* d3dDevice,
_In_opt_ ID3D11DeviceContext* d3dContext,
_In_z_ const wchar_t* szFileName,
_In_ size_t maxsize,
diff --git a/Core/DXUT.h b/Core/DXUT.h
index fc6247e..a0e06fa 100644
--- a/Core/DXUT.h
+++ b/Core/DXUT.h
@@ -12,6 +12,12 @@
//--------------------------------------------------------------------------------------
#pragma once
+#ifdef DXUT_EXPORT
+ #define DXUT_API __declspec(dllexport)
+#else
+ #define DXUT_API __declspec(dllimport)
+#endif
+
#ifndef UNICODE
#error "DXUT requires a Unicode build."
#endif
@@ -207,68 +213,68 @@ typedef void (CALLBACK *LPDXUTCALLBACKD3D11SWAPCHAINRELEASING)( _In_opt_ void
typedef void (CALLBACK *LPDXUTCALLBACKD3D11DEVICEDESTROYED)( _In_opt_ void* pUserContext );
// General callbacks
-void WINAPI DXUTSetCallbackFrameMove( _In_ LPDXUTCALLBACKFRAMEMOVE pCallback, _In_opt_ void* pUserContext = nullptr );
-void WINAPI DXUTSetCallbackKeyboard( _In_ LPDXUTCALLBACKKEYBOARD pCallback, _In_opt_ void* pUserContext = nullptr );
-void WINAPI DXUTSetCallbackMouse( _In_ LPDXUTCALLBACKMOUSE pCallback, bool bIncludeMouseMove = false, _In_opt_ void* pUserContext = nullptr );
-void WINAPI DXUTSetCallbackMsgProc( _In_ LPDXUTCALLBACKMSGPROC pCallback, _In_opt_ void* pUserContext = nullptr );
-void WINAPI DXUTSetCallbackDeviceChanging( _In_ LPDXUTCALLBACKMODIFYDEVICESETTINGS pCallback, _In_opt_ void* pUserContext = nullptr );
-void WINAPI DXUTSetCallbackDeviceRemoved( _In_ LPDXUTCALLBACKDEVICEREMOVED pCallback, _In_opt_ void* pUserContext = nullptr );
+void DXUT_API WINAPI DXUTSetCallbackFrameMove( _In_ LPDXUTCALLBACKFRAMEMOVE pCallback, _In_opt_ void* pUserContext = nullptr );
+void DXUT_API WINAPI DXUTSetCallbackKeyboard( _In_ LPDXUTCALLBACKKEYBOARD pCallback, _In_opt_ void* pUserContext = nullptr );
+void DXUT_API WINAPI DXUTSetCallbackMouse( _In_ LPDXUTCALLBACKMOUSE pCallback, bool bIncludeMouseMove = false, _In_opt_ void* pUserContext = nullptr );
+void DXUT_API WINAPI DXUTSetCallbackMsgProc( _In_ LPDXUTCALLBACKMSGPROC pCallback, _In_opt_ void* pUserContext = nullptr );
+void DXUT_API WINAPI DXUTSetCallbackDeviceChanging( _In_ LPDXUTCALLBACKMODIFYDEVICESETTINGS pCallback, _In_opt_ void* pUserContext = nullptr );
+void DXUT_API WINAPI DXUTSetCallbackDeviceRemoved( _In_ LPDXUTCALLBACKDEVICEREMOVED pCallback, _In_opt_ void* pUserContext = nullptr );
// Direct3D 11 callbacks
-void WINAPI DXUTSetCallbackD3D11DeviceAcceptable( _In_ LPDXUTCALLBACKISD3D11DEVICEACCEPTABLE pCallback, _In_opt_ void* pUserContext = nullptr );
-void WINAPI DXUTSetCallbackD3D11DeviceCreated( _In_ LPDXUTCALLBACKD3D11DEVICECREATED pCallback, _In_opt_ void* pUserContext = nullptr );
-void WINAPI DXUTSetCallbackD3D11SwapChainResized( _In_ LPDXUTCALLBACKD3D11SWAPCHAINRESIZED pCallback, _In_opt_ void* pUserContext = nullptr );
-void WINAPI DXUTSetCallbackD3D11FrameRender( _In_ LPDXUTCALLBACKD3D11FRAMERENDER pCallback, _In_opt_ void* pUserContext = nullptr );
-void WINAPI DXUTSetCallbackD3D11SwapChainReleasing( _In_ LPDXUTCALLBACKD3D11SWAPCHAINRELEASING pCallback, _In_opt_ void* pUserContext = nullptr );
-void WINAPI DXUTSetCallbackD3D11DeviceDestroyed( _In_ LPDXUTCALLBACKD3D11DEVICEDESTROYED pCallback, _In_opt_ void* pUserContext = nullptr );
+void DXUT_API WINAPI DXUTSetCallbackD3D11DeviceAcceptable( _In_ LPDXUTCALLBACKISD3D11DEVICEACCEPTABLE pCallback, _In_opt_ void* pUserContext = nullptr );
+void DXUT_API WINAPI DXUTSetCallbackD3D11DeviceCreated( _In_ LPDXUTCALLBACKD3D11DEVICECREATED pCallback, _In_opt_ void* pUserContext = nullptr );
+void DXUT_API WINAPI DXUTSetCallbackD3D11SwapChainResized( _In_ LPDXUTCALLBACKD3D11SWAPCHAINRESIZED pCallback, _In_opt_ void* pUserContext = nullptr );
+void DXUT_API WINAPI DXUTSetCallbackD3D11FrameRender( _In_ LPDXUTCALLBACKD3D11FRAMERENDER pCallback, _In_opt_ void* pUserContext = nullptr );
+void DXUT_API WINAPI DXUTSetCallbackD3D11SwapChainReleasing( _In_ LPDXUTCALLBACKD3D11SWAPCHAINRELEASING pCallback, _In_opt_ void* pUserContext = nullptr );
+void DXUT_API WINAPI DXUTSetCallbackD3D11DeviceDestroyed( _In_ LPDXUTCALLBACKD3D11DEVICEDESTROYED pCallback, _In_opt_ void* pUserContext = nullptr );
//--------------------------------------------------------------------------------------
// Initialization
//--------------------------------------------------------------------------------------
-HRESULT WINAPI DXUTInit( _In_ bool bParseCommandLine = true,
+HRESULT DXUT_API WINAPI DXUTInit( _In_ bool bParseCommandLine = true,
_In_ bool bShowMsgBoxOnError = true,
_In_opt_ WCHAR* strExtraCommandLineParams = nullptr,
_In_ bool bThreadSafeDXUT = false );
// Choose either DXUTCreateWindow or DXUTSetWindow. If using DXUTSetWindow, consider using DXUTStaticWndProc
-HRESULT WINAPI DXUTCreateWindow( _In_z_ const WCHAR* strWindowTitle = L"Direct3D Window",
+HRESULT DXUT_API WINAPI DXUTCreateWindow( _In_z_ const WCHAR* strWindowTitle = L"Direct3D Window",
_In_opt_ HINSTANCE hInstance = nullptr, _In_opt_ HICON hIcon = nullptr, _In_opt_ HMENU hMenu = nullptr,
_In_ int x = CW_USEDEFAULT, _In_ int y = CW_USEDEFAULT );
-HRESULT WINAPI DXUTSetWindow( _In_ HWND hWndFocus, _In_ HWND hWndDeviceFullScreen, _In_ HWND hWndDeviceWindowed, _In_ bool bHandleMessages = true );
-LRESULT CALLBACK DXUTStaticWndProc( _In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam );
+HRESULT DXUT_API WINAPI DXUTSetWindow( _In_ HWND hWndFocus, _In_ HWND hWndDeviceFullScreen, _In_ HWND hWndDeviceWindowed, _In_ bool bHandleMessages = true );
+LRESULT DXUT_API CALLBACK DXUTStaticWndProc( _In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam );
// Choose either DXUTCreateDevice or DXUTCreateD3DDeviceFromSettings
-HRESULT WINAPI DXUTCreateDevice(_In_ D3D_FEATURE_LEVEL reqFL, _In_ bool bWindowed= true, _In_ int nSuggestedWidth =0,_In_ int nSuggestedHeight =0 );
-HRESULT WINAPI DXUTCreateDeviceFromSettings( _In_ DXUTDeviceSettings* pDeviceSettings, _In_ bool bClipWindowToSingleAdapter = true );
+HRESULT DXUT_API WINAPI DXUTCreateDevice(_In_ D3D_FEATURE_LEVEL reqFL, _In_ bool bWindowed= true, _In_ int nSuggestedWidth =0,_In_ int nSuggestedHeight =0 );
+HRESULT DXUT_API WINAPI DXUTCreateDeviceFromSettings( _In_ DXUTDeviceSettings* pDeviceSettings, _In_ bool bClipWindowToSingleAdapter = true );
// Choose either DXUTMainLoop or implement your own main loop
-HRESULT WINAPI DXUTMainLoop( _In_opt_ HACCEL hAccel = nullptr );
+HRESULT DXUT_API WINAPI DXUTMainLoop( _In_opt_ HACCEL hAccel = nullptr );
// If not using DXUTMainLoop consider using DXUTRender3DEnvironment
-void WINAPI DXUTRender3DEnvironment();
+void DXUT_API WINAPI DXUTRender3DEnvironment();
//--------------------------------------------------------------------------------------
// Common Tasks
//--------------------------------------------------------------------------------------
-HRESULT WINAPI DXUTToggleFullScreen();
-HRESULT WINAPI DXUTToggleREF();
-HRESULT WINAPI DXUTToggleWARP();
-void WINAPI DXUTPause( _In_ bool bPauseTime, _In_ bool bPauseRendering );
-void WINAPI DXUTSetConstantFrameTime( _In_ bool bConstantFrameTime, _In_ float fTimePerFrame = 0.0333f );
-void WINAPI DXUTSetCursorSettings( _In_ bool bShowCursorWhenFullScreen = false, _In_ bool bClipCursorWhenFullScreen = false );
-void WINAPI DXUTSetHotkeyHandling( _In_ bool bAltEnterToToggleFullscreen = true, _In_ bool bEscapeToQuit = true, _In_ bool bPauseToToggleTimePause = true );
-void WINAPI DXUTSetMultimonSettings( _In_ bool bAutoChangeAdapter = true );
-void WINAPI DXUTSetShortcutKeySettings( _In_ bool bAllowWhenFullscreen = false, _In_ bool bAllowWhenWindowed = true ); // Controls the Windows key, and accessibility shortcut keys
-void WINAPI DXUTSetWindowSettings( _In_ bool bCallDefWindowProc = true );
-HRESULT WINAPI DXUTSetTimer( _In_ LPDXUTCALLBACKTIMER pCallbackTimer, _In_ float fTimeoutInSecs = 1.0f, _Out_opt_ UINT* pnIDEvent = nullptr, _In_opt_ void* pCallbackUserContext = nullptr );
-HRESULT WINAPI DXUTKillTimer( _In_ UINT nIDEvent );
-void WINAPI DXUTResetFrameworkState();
-void WINAPI DXUTShutdown( _In_ int nExitCode = 0 );
-void WINAPI DXUTSetIsInGammaCorrectMode( _In_ bool bGammaCorrect );
-bool WINAPI DXUTGetMSAASwapChainCreated();
+HRESULT DXUT_API WINAPI DXUTToggleFullScreen();
+HRESULT DXUT_API WINAPI DXUTToggleREF();
+HRESULT DXUT_API WINAPI DXUTToggleWARP();
+void DXUT_API WINAPI DXUTPause( _In_ bool bPauseTime, _In_ bool bPauseRendering );
+void DXUT_API WINAPI DXUTSetConstantFrameTime( _In_ bool bConstantFrameTime, _In_ float fTimePerFrame = 0.0333f );
+void DXUT_API WINAPI DXUTSetCursorSettings( _In_ bool bShowCursorWhenFullScreen = false, _In_ bool bClipCursorWhenFullScreen = false );
+void DXUT_API WINAPI DXUTSetHotkeyHandling( _In_ bool bAltEnterToToggleFullscreen = true, _In_ bool bEscapeToQuit = true, _In_ bool bPauseToToggleTimePause = true );
+void DXUT_API WINAPI DXUTSetMultimonSettings( _In_ bool bAutoChangeAdapter = true );
+void DXUT_API WINAPI DXUTSetShortcutKeySettings( _In_ bool bAllowWhenFullscreen = false, _In_ bool bAllowWhenWindowed = true ); // Controls the Windows key, and accessibility shortcut keys
+void DXUT_API WINAPI DXUTSetWindowSettings( _In_ bool bCallDefWindowProc = true );
+HRESULT DXUT_API WINAPI DXUTSetTimer( _In_ LPDXUTCALLBACKTIMER pCallbackTimer, _In_ float fTimeoutInSecs = 1.0f, _Out_opt_ UINT* pnIDEvent = nullptr, _In_opt_ void* pCallbackUserContext = nullptr );
+HRESULT DXUT_API WINAPI DXUTKillTimer( _In_ UINT nIDEvent );
+void DXUT_API WINAPI DXUTResetFrameworkState();
+void DXUT_API WINAPI DXUTShutdown( _In_ int nExitCode = 0 );
+void DXUT_API WINAPI DXUTSetIsInGammaCorrectMode( _In_ bool bGammaCorrect );
+bool DXUT_API WINAPI DXUTGetMSAASwapChainCreated();
//--------------------------------------------------------------------------------------
@@ -276,63 +282,63 @@ bool WINAPI DXUTGetMSAASwapChainCreated();
//--------------------------------------------------------------------------------------
// Direct3D 11.x (These do not addref unlike typical Get* APIs)
-IDXGIFactory1* WINAPI DXUTGetDXGIFactory();
-IDXGISwapChain* WINAPI DXUTGetDXGISwapChain();
-const DXGI_SURFACE_DESC* WINAPI DXUTGetDXGIBackBufferSurfaceDesc();
-HRESULT WINAPI DXUTSetupD3D11Views( _In_ ID3D11DeviceContext* pd3dDeviceContext ); // Supports immediate or deferred context
-D3D_FEATURE_LEVEL WINAPI DXUTGetD3D11DeviceFeatureLevel(); // Returns the D3D11 devices current feature level
-ID3D11RenderTargetView* WINAPI DXUTGetD3D11RenderTargetView();
-ID3D11DepthStencilView* WINAPI DXUTGetD3D11DepthStencilView();
+DXUT_API IDXGIFactory1* WINAPI DXUTGetDXGIFactory();
+DXUT_API IDXGISwapChain* WINAPI DXUTGetDXGISwapChain();
+DXUT_API const DXGI_SURFACE_DESC* WINAPI DXUTGetDXGIBackBufferSurfaceDesc();
+DXUT_API HRESULT WINAPI DXUTSetupD3D11Views(_In_ ID3D11DeviceContext* pd3dDeviceContext); // Supports immediate or deferred context
+DXUT_API D3D_FEATURE_LEVEL WINAPI DXUTGetD3D11DeviceFeatureLevel(); // Returns the D3D11 devices current feature level
+DXUT_API ID3D11RenderTargetView* WINAPI DXUTGetD3D11RenderTargetView();
+DXUT_API ID3D11DepthStencilView* WINAPI DXUTGetD3D11DepthStencilView();
-ID3D11Device* WINAPI DXUTGetD3D11Device();
-ID3D11DeviceContext* WINAPI DXUTGetD3D11DeviceContext();
+DXUT_API ID3D11Device* WINAPI DXUTGetD3D11Device();
+DXUT_API ID3D11DeviceContext* WINAPI DXUTGetD3D11DeviceContext();
-ID3D11Device1* WINAPI DXUTGetD3D11Device1();
-ID3D11DeviceContext1* WINAPI DXUTGetD3D11DeviceContext1();
+DXUT_API ID3D11Device1* WINAPI DXUTGetD3D11Device1();
+DXUT_API ID3D11DeviceContext1* WINAPI DXUTGetD3D11DeviceContext1();
#ifdef USE_DIRECT3D11_2
-ID3D11Device2* WINAPI DXUTGetD3D11Device2();
-ID3D11DeviceContext2* WINAPI DXUTGetD3D11DeviceContext2();
+DXUT_API ID3D11Device2* WINAPI DXUTGetD3D11Device2();
+DXUT_API ID3D11DeviceContext2* WINAPI DXUTGetD3D11DeviceContext2();
#endif
#ifdef USE_DIRECT3D11_3
-ID3D11Device3* WINAPI DXUTGetD3D11Device3();
-ID3D11DeviceContext3* WINAPI DXUTGetD3D11DeviceContext3();
+DXUT_API ID3D11Device3* WINAPI DXUTGetD3D11Device3();
+DXUT_API ID3D11DeviceContext3* WINAPI DXUTGetD3D11DeviceContext3();
#endif
// General
-DXUTDeviceSettings WINAPI DXUTGetDeviceSettings();
-HINSTANCE WINAPI DXUTGetHINSTANCE();
-HWND WINAPI DXUTGetHWND();
-HWND WINAPI DXUTGetHWNDFocus();
-HWND WINAPI DXUTGetHWNDDeviceFullScreen();
-HWND WINAPI DXUTGetHWNDDeviceWindowed();
-RECT WINAPI DXUTGetWindowClientRect();
-LONG WINAPI DXUTGetWindowWidth();
-LONG WINAPI DXUTGetWindowHeight();
-RECT WINAPI DXUTGetWindowClientRectAtModeChange(); // Useful for returning to windowed mode with the same resolution as before toggle to full screen mode
-RECT WINAPI DXUTGetFullsceenClientRectAtModeChange(); // Useful for returning to full screen mode with the same resolution as before toggle to windowed mode
-double WINAPI DXUTGetTime();
-float WINAPI DXUTGetElapsedTime();
-bool WINAPI DXUTIsWindowed();
-bool WINAPI DXUTIsInGammaCorrectMode();
-float WINAPI DXUTGetFPS();
-LPCWSTR WINAPI DXUTGetWindowTitle();
-LPCWSTR WINAPI DXUTGetFrameStats( _In_ bool bIncludeFPS = false );
-LPCWSTR WINAPI DXUTGetDeviceStats();
-
-bool WINAPI DXUTIsVsyncEnabled();
-bool WINAPI DXUTIsRenderingPaused();
-bool WINAPI DXUTIsTimePaused();
-bool WINAPI DXUTIsActive();
-int WINAPI DXUTGetExitCode();
-bool WINAPI DXUTGetShowMsgBoxOnError();
-bool WINAPI DXUTGetAutomation(); // Returns true if -automation parameter is used to launch the app
-bool WINAPI DXUTIsKeyDown( _In_ BYTE vKey ); // Pass a virtual-key code, ex. VK_F1, 'A', VK_RETURN, VK_LSHIFT, etc
-bool WINAPI DXUTWasKeyPressed( _In_ BYTE vKey ); // Like DXUTIsKeyDown() but return true only if the key was just pressed
-bool WINAPI DXUTIsMouseButtonDown( _In_ BYTE vButton ); // Pass a virtual-key code: VK_LBUTTON, VK_RBUTTON, VK_MBUTTON, VK_XBUTTON1, VK_XBUTTON2
-HRESULT WINAPI DXUTCreateState(); // Optional method to create DXUT's memory. If its not called by the application it will be automatically called when needed
-void WINAPI DXUTDestroyState(); // Optional method to destroy DXUT's memory. If its not called by the application it will be automatically called after the application exits WinMain
+DXUTDeviceSettings DXUT_API WINAPI DXUTGetDeviceSettings();
+HINSTANCE DXUT_API WINAPI DXUTGetHINSTANCE();
+HWND DXUT_API WINAPI DXUTGetHWND();
+HWND DXUT_API WINAPI DXUTGetHWNDFocus();
+HWND DXUT_API WINAPI DXUTGetHWNDDeviceFullScreen();
+HWND DXUT_API WINAPI DXUTGetHWNDDeviceWindowed();
+RECT DXUT_API WINAPI DXUTGetWindowClientRect();
+LONG DXUT_API WINAPI DXUTGetWindowWidth();
+LONG DXUT_API WINAPI DXUTGetWindowHeight();
+RECT DXUT_API WINAPI DXUTGetWindowClientRectAtModeChange(); // Useful for returning to windowed mode with the same resolution as before toggle to full screen mode
+RECT DXUT_API WINAPI DXUTGetFullsceenClientRectAtModeChange(); // Useful for returning to full screen mode with the same resolution as before toggle to windowed mode
+double DXUT_API WINAPI DXUTGetTime();
+float DXUT_API WINAPI DXUTGetElapsedTime();
+bool DXUT_API WINAPI DXUTIsWindowed();
+bool DXUT_API WINAPI DXUTIsInGammaCorrectMode();
+float DXUT_API WINAPI DXUTGetFPS();
+LPCWSTR DXUT_API WINAPI DXUTGetWindowTitle();
+LPCWSTR DXUT_API WINAPI DXUTGetFrameStats( _In_ bool bIncludeFPS = false );
+LPCWSTR DXUT_API WINAPI DXUTGetDeviceStats();
+
+bool DXUT_API WINAPI DXUTIsVsyncEnabled();
+bool DXUT_API WINAPI DXUTIsRenderingPaused();
+bool DXUT_API WINAPI DXUTIsTimePaused();
+bool DXUT_API WINAPI DXUTIsActive();
+int DXUT_API WINAPI DXUTGetExitCode();
+bool DXUT_API WINAPI DXUTGetShowMsgBoxOnError();
+bool DXUT_API WINAPI DXUTGetAutomation(); // Returns true if -automation parameter is used to launch the app
+bool DXUT_API WINAPI DXUTIsKeyDown( _In_ BYTE vKey ); // Pass a virtual-key code, ex. VK_F1, 'A', VK_RETURN, VK_LSHIFT, etc
+bool DXUT_API WINAPI DXUTWasKeyPressed( _In_ BYTE vKey ); // Like DXUTIsKeyDown() but return true only if the key was just pressed
+bool DXUT_API WINAPI DXUTIsMouseButtonDown( _In_ BYTE vButton ); // Pass a virtual-key code: VK_LBUTTON, VK_RBUTTON, VK_MBUTTON, VK_XBUTTON1, VK_XBUTTON2
+HRESULT DXUT_API WINAPI DXUTCreateState(); // Optional method to create DXUT's memory. If its not called by the application it will be automatically called when needed
+void DXUT_API WINAPI DXUTDestroyState(); // Optional method to destroy DXUT's memory. If its not called by the application it will be automatically called after the application exits WinMain
//--------------------------------------------------------------------------------------
// DXUT core layer includes
diff --git a/Core/DXUTDevice11.h b/Core/DXUTDevice11.h
index 1e38a63..e607463 100644
--- a/Core/DXUTDevice11.h
+++ b/Core/DXUTDevice11.h
@@ -14,12 +14,14 @@
//--------------------------------------------------------------------------------------
#pragma once
-void DXUTApplyDefaultDeviceSettings(DXUTDeviceSettings *modifySettings);
+#pragma warning(disable: 4251)
+
+DXUT_API void DXUTApplyDefaultDeviceSettings(DXUTDeviceSettings *modifySettings);
//--------------------------------------------------------------------------------------
// Functions to get bit depth from formats
//--------------------------------------------------------------------------------------
-HRESULT WINAPI DXUTGetD3D11AdapterDisplayMode( _In_ UINT AdapterOrdinal, _In_ UINT Output, _Out_ DXGI_MODE_DESC* pModeDesc );
+DXUT_API HRESULT WINAPI DXUTGetD3D11AdapterDisplayMode( _In_ UINT AdapterOrdinal, _In_ UINT Output, _Out_ DXGI_MODE_DESC* pModeDesc );
@@ -28,7 +30,7 @@ HRESULT WINAPI DXUTGetD3D11AdapterDisplayMode( _In_ UINT AdapterOrdinal, _In_ UI
// Optional memory create/destory functions. If not call, these will be called automatically
//--------------------------------------------------------------------------------------
HRESULT WINAPI DXUTCreateD3D11Enumeration();
-void WINAPI DXUTDestroyD3D11Enumeration();
+DXUT_API void WINAPI DXUTDestroyD3D11Enumeration();
@@ -46,7 +48,7 @@ struct CD3D11EnumDeviceSettingsCombo;
//--------------------------------------------------------------------------------------
// Enumerates available Direct3D11 adapters, devices, modes, etc.
//--------------------------------------------------------------------------------------
-class CD3D11Enumeration
+class DXUT_API CD3D11Enumeration
{
public:
// These should be called before Enumerate().
@@ -106,7 +108,7 @@ private:
void ClearAdapterInfoList();
};
-CD3D11Enumeration* WINAPI DXUTGetD3D11Enumeration(_In_ bool bForceEnumerate = false, _In_ bool EnumerateAllAdapterFormats = true, _In_ D3D_FEATURE_LEVEL forceFL = ((D3D_FEATURE_LEVEL )0) );
+DXUT_API CD3D11Enumeration* WINAPI DXUTGetD3D11Enumeration(_In_ bool bForceEnumerate = false, _In_ bool EnumerateAllAdapterFormats = true, _In_ D3D_FEATURE_LEVEL forceFL = ((D3D_FEATURE_LEVEL )0) );
#define DXGI_MAX_DEVICE_IDENTIFIER_STRING 128
@@ -115,7 +117,7 @@ CD3D11Enumeration* WINAPI DXUTGetD3D11Enumeration(_In_ bool bForceEnumerate = fa
// A class describing an adapter which contains a unique adapter ordinal
// that is installed on the system
//--------------------------------------------------------------------------------------
-class CD3D11EnumAdapterInfo
+class DXUT_API CD3D11EnumAdapterInfo
{
const CD3D11EnumAdapterInfo &operator = ( const CD3D11EnumAdapterInfo &rhs );
@@ -144,7 +146,7 @@ public:
};
-class CD3D11EnumOutputInfo
+class DXUT_API CD3D11EnumOutputInfo
{
const CD3D11EnumOutputInfo &operator = ( const CD3D11EnumOutputInfo &rhs );
@@ -167,7 +169,7 @@ public:
//--------------------------------------------------------------------------------------
// A class describing a Direct3D11 device that contains a unique supported driver type
//--------------------------------------------------------------------------------------
-class CD3D11EnumDeviceInfo
+class DXUT_API CD3D11EnumDeviceInfo
{
const CD3D11EnumDeviceInfo& operator =( const CD3D11EnumDeviceInfo& rhs );
@@ -187,7 +189,7 @@ public:
// adapter format, back buffer format, and windowed that is compatible with a
// particular Direct3D device and the app.
//--------------------------------------------------------------------------------------
-struct CD3D11EnumDeviceSettingsCombo
+struct DXUT_API CD3D11EnumDeviceSettingsCombo
{
UINT AdapterOrdinal;
D3D_DRIVER_TYPE DeviceType;
@@ -203,7 +205,7 @@ struct CD3D11EnumDeviceSettingsCombo
CD3D11EnumOutputInfo* pOutputInfo;
};
-float DXUTRankD3D11DeviceCombo( _In_ CD3D11EnumDeviceSettingsCombo* pDeviceSettingsCombo,
+float DXUT_API DXUTRankD3D11DeviceCombo( _In_ CD3D11EnumDeviceSettingsCombo* pDeviceSettingsCombo,
_In_ DXUTD3D11DeviceSettings* pOptimalDeviceSettings,
_Out_ int &bestModeIndex,
_Out_ int &bestMSAAIndex
diff --git a/Core/DXUT_2015.vcxproj b/Core/DXUT_2015.vcxproj
index 6d6c522..62b0708 100644
--- a/Core/DXUT_2015.vcxproj
+++ b/Core/DXUT_2015.vcxproj
@@ -34,35 +34,35 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|X64'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|X64'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile|X64'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
@@ -147,7 +147,7 @@
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<ExceptionHandling>Sync</ExceptionHandling>
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
- <PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>DXUT_EXPORT;WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
@@ -156,7 +156,7 @@
</ClCompile>
<Link>
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
- <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<LargeAddressAware>true</LargeAddressAware>
@@ -188,7 +188,7 @@
<FloatingPointModel>Fast</FloatingPointModel>
<ExceptionHandling>Sync</ExceptionHandling>
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
- <PreprocessorDefinitions>WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>DXUT_EXPORT;WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<PrecompiledHeader>Use</PrecompiledHeader>
@@ -196,7 +196,7 @@
</ClCompile>
<Link>
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
- <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<LargeAddressAware>true</LargeAddressAware>
@@ -230,14 +230,14 @@
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<ExceptionHandling>Sync</ExceptionHandling>
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
- <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>DXUT_EXPORT;WIN32;NDEBUG;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>DXUT.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
- <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
@@ -272,14 +272,14 @@
<FloatingPointModel>Fast</FloatingPointModel>
<ExceptionHandling>Sync</ExceptionHandling>
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
- <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>DXUT_EXPORT;WIN32;NDEBUG;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>DXUT.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
- <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
@@ -315,14 +315,14 @@
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<ExceptionHandling>Sync</ExceptionHandling>
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
- <PreprocessorDefinitions>WIN32;NDEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>DXUT_EXPORT;WIN32;NDEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>DXUT.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
- <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
@@ -357,14 +357,14 @@
<FloatingPointModel>Fast</FloatingPointModel>
<ExceptionHandling>Sync</ExceptionHandling>
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
- <PreprocessorDefinitions>WIN32;NDEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>DXUT_EXPORT;WIN32;NDEBUG;PROFILE;_WINDOWS;_LIB;USE_DIRECT3D11_2;_WIN32_WINNT=0x0600;_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>DXUT.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<AdditionalOptions> %(AdditionalOptions)</AdditionalOptions>
- <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
diff --git a/Core/DXUTmisc.h b/Core/DXUTmisc.h
index 9706ccc..74ab666 100644
--- a/Core/DXUTmisc.h
+++ b/Core/DXUTmisc.h
@@ -62,23 +62,23 @@ struct DXUT_GAMEPAD
bool bLastRightTrigger;
};
-HRESULT DXUTGetGamepadState( _In_ DWORD dwPort, _In_ DXUT_GAMEPAD* pGamePad, _In_ bool bThumbstickDeadZone = true,
+HRESULT DXUT_API DXUTGetGamepadState( _In_ DWORD dwPort, _In_ DXUT_GAMEPAD* pGamePad, _In_ bool bThumbstickDeadZone = true,
_In_ bool bSnapThumbstickToCardinals = true );
-HRESULT DXUTStopRumbleOnAllControllers();
-void DXUTEnableXInput( _In_ bool bEnable );
+HRESULT DXUT_API DXUTStopRumbleOnAllControllers();
+void DXUT_API DXUTEnableXInput( _In_ bool bEnable );
//--------------------------------------------------------------------------------------
// Takes a screen shot of a 32bit D3D11 back buffer and saves the images to a BMP or DDS file
//--------------------------------------------------------------------------------------
-HRESULT DXUTSnapD3D11Screenshot( _In_z_ LPCWSTR szFileName, _In_ bool usedds = true );
+HRESULT DXUT_API DXUTSnapD3D11Screenshot( _In_z_ LPCWSTR szFileName, _In_ bool usedds = true );
//--------------------------------------------------------------------------------------
// Performs timer operations
// Use DXUTGetGlobalTimer() to get the global instance
//--------------------------------------------------------------------------------------
-class CDXUTTimer
+class DXUT_API CDXUTTimer
{
public:
CDXUTTimer();
@@ -109,24 +109,24 @@ protected:
LONGLONG m_llBaseTime;
};
-CDXUTTimer* WINAPI DXUTGetGlobalTimer();
+DXUT_API CDXUTTimer* WINAPI DXUTGetGlobalTimer();
//--------------------------------------------------------------------------------------
// Returns the string for the given DXGI_FORMAT.
// bWithPrefix determines whether the string should include the "DXGI_FORMAT_"
//--------------------------------------------------------------------------------------
-LPCWSTR WINAPI DXUTDXGIFormatToString( _In_ DXGI_FORMAT format, _In_ bool bWithPrefix );
+DXUT_API LPCWSTR WINAPI DXUTDXGIFormatToString( _In_ DXGI_FORMAT format, _In_ bool bWithPrefix );
//--------------------------------------------------------------------------------------
// Debug printing support
// See dxerr.h for more debug printing support
//--------------------------------------------------------------------------------------
-void WINAPI DXUTOutputDebugStringW( _In_z_ LPCWSTR strMsg, ... );
-void WINAPI DXUTOutputDebugStringA( _In_z_ LPCSTR strMsg, ... );
-HRESULT WINAPI DXUTTrace( _In_z_ const CHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_z_ const WCHAR* strMsg, _In_ bool bPopMsgBox );
-const WCHAR* WINAPI DXUTTraceWindowsMessage( _In_ UINT uMsg );
+DXUT_API void WINAPI DXUTOutputDebugStringW( _In_z_ LPCWSTR strMsg, ... );
+DXUT_API void WINAPI DXUTOutputDebugStringA( _In_z_ LPCSTR strMsg, ... );
+DXUT_API HRESULT WINAPI DXUTTrace( _In_z_ const CHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_z_ const WCHAR* strMsg, _In_ bool bPopMsgBox );
+DXUT_API const WCHAR* WINAPI DXUTTraceWindowsMessage( _In_ UINT uMsg );
#ifdef UNICODE
#define DXUTOutputDebugString DXUTOutputDebugStringW
@@ -152,17 +152,17 @@ const WCHAR* WINAPI DXUTTraceWindowsMessage( _In_ UINT uMsg );
// failure if APIs are not present.
//--------------------------------------------------------------------------------------
-int WINAPI DXUT_Dynamic_D3DPERF_BeginEvent( _In_ DWORD col, _In_z_ LPCWSTR wszName );
-int WINAPI DXUT_Dynamic_D3DPERF_EndEvent( void );
-void WINAPI DXUT_Dynamic_D3DPERF_SetMarker( _In_ DWORD col, _In_z_ LPCWSTR wszName );
-void WINAPI DXUT_Dynamic_D3DPERF_SetRegion( _In_ DWORD col, _In_z_ LPCWSTR wszName );
-BOOL WINAPI DXUT_Dynamic_D3DPERF_QueryRepeatFrame( void );
-void WINAPI DXUT_Dynamic_D3DPERF_SetOptions( _In_ DWORD dwOptions );
-DWORD WINAPI DXUT_Dynamic_D3DPERF_GetStatus();
-HRESULT WINAPI DXUT_Dynamic_CreateDXGIFactory1( _In_ REFIID rInterface, _Out_ void** ppOut );
-HRESULT WINAPI DXUT_Dynamic_DXGIGetDebugInterface( _In_ REFIID rInterface, _Out_ void** ppOut );
-
-HRESULT WINAPI DXUT_Dynamic_D3D11CreateDevice( _In_opt_ IDXGIAdapter* pAdapter,
+DXUT_API int WINAPI DXUT_Dynamic_D3DPERF_BeginEvent( _In_ DWORD col, _In_z_ LPCWSTR wszName );
+DXUT_API int WINAPI DXUT_Dynamic_D3DPERF_EndEvent( void );
+DXUT_API void WINAPI DXUT_Dynamic_D3DPERF_SetMarker( _In_ DWORD col, _In_z_ LPCWSTR wszName );
+DXUT_API void WINAPI DXUT_Dynamic_D3DPERF_SetRegion( _In_ DWORD col, _In_z_ LPCWSTR wszName );
+DXUT_API BOOL WINAPI DXUT_Dynamic_D3DPERF_QueryRepeatFrame( void );
+DXUT_API void WINAPI DXUT_Dynamic_D3DPERF_SetOptions( _In_ DWORD dwOptions );
+DXUT_API DWORD WINAPI DXUT_Dynamic_D3DPERF_GetStatus();
+DXUT_API HRESULT WINAPI DXUT_Dynamic_CreateDXGIFactory1( _In_ REFIID rInterface, _Out_ void** ppOut );
+DXUT_API HRESULT WINAPI DXUT_Dynamic_DXGIGetDebugInterface( _In_ REFIID rInterface, _Out_ void** ppOut );
+
+DXUT_API HRESULT WINAPI DXUT_Dynamic_D3D11CreateDevice( _In_opt_ IDXGIAdapter* pAdapter,
_In_ D3D_DRIVER_TYPE DriverType,
_In_opt_ HMODULE Software,
_In_ UINT32 Flags,
@@ -173,7 +173,7 @@ HRESULT WINAPI DXUT_Dynamic_D3D11CreateDevice( _In_opt_ IDXGIAdapter* pAdapter,
_Out_opt_ D3D_FEATURE_LEVEL* pFeatureLevel,
_Out_opt_ ID3D11DeviceContext** ppImmediateContext );
-bool DXUT_EnsureD3D11APIs();
+DXUT_API bool DXUT_EnsureD3D11APIs();
//--------------------------------------------------------------------------------------
@@ -285,14 +285,14 @@ typedef MONITORINFOEXW MONITORINFOEX;
typedef LPMONITORINFOEXW LPMONITORINFOEX;
#endif
-HMONITOR WINAPI DXUTMonitorFromWindow( _In_ HWND hWnd, _In_ DWORD dwFlags );
-HMONITOR WINAPI DXUTMonitorFromRect( _In_ LPCRECT lprcScreenCoords, _In_ DWORD dwFlags );
-BOOL WINAPI DXUTGetMonitorInfo( _In_ HMONITOR hMonitor, _Out_ LPMONITORINFO lpMonitorInfo );
-void WINAPI DXUTGetDesktopResolution( _In_ UINT AdapterOrdinal, _Out_ UINT* pWidth, _Out_ UINT* pHeight );
+DXUT_API HMONITOR WINAPI DXUTMonitorFromWindow( _In_ HWND hWnd, _In_ DWORD dwFlags );
+DXUT_API HMONITOR WINAPI DXUTMonitorFromRect( _In_ LPCRECT lprcScreenCoords, _In_ DWORD dwFlags );
+DXUT_API BOOL WINAPI DXUTGetMonitorInfo( _In_ HMONITOR hMonitor, _Out_ LPMONITORINFO lpMonitorInfo );
+DXUT_API void WINAPI DXUTGetDesktopResolution( _In_ UINT AdapterOrdinal, _Out_ UINT* pWidth, _Out_ UINT* pHeight );
//--------------------------------------------------------------------------------------
// Helper functions to create SRGB formats from typeless formats and vice versa
//--------------------------------------------------------------------------------------
-DXGI_FORMAT MAKE_SRGB( _In_ DXGI_FORMAT format );
-DXGI_FORMAT MAKE_TYPELESS( _In_ DXGI_FORMAT format );
+DXUT_API DXGI_FORMAT MAKE_SRGB( _In_ DXGI_FORMAT format );
+DXUT_API DXGI_FORMAT MAKE_TYPELESS( _In_ DXGI_FORMAT format );
diff --git a/Core/ScreenGrab.h b/Core/ScreenGrab.h
index d643073..cf4eba6 100644
--- a/Core/ScreenGrab.h
+++ b/Core/ScreenGrab.h
@@ -27,14 +27,20 @@
#include <stdint.h>
#include <functional>
+#ifdef DXUT_EXPORT
+ #define DXUT_API __declspec(dllexport)
+#else
+ #define DXUT_API __declspec(dllimport)
+#endif
+
namespace DirectX
{
- HRESULT SaveDDSTextureToFile( _In_ ID3D11DeviceContext* pContext,
+ DXUT_API HRESULT SaveDDSTextureToFile( _In_ ID3D11DeviceContext* pContext,
_In_ ID3D11Resource* pSource,
_In_z_ LPCWSTR fileName );
- HRESULT SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext,
+ DXUT_API HRESULT SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext,
_In_ ID3D11Resource* pSource,
_In_ REFGUID guidContainerFormat,
_In_z_ LPCWSTR fileName,
diff --git a/Core/WICTextureLoader.h b/Core/WICTextureLoader.h
index 2b0340c..f2edacf 100644
--- a/Core/WICTextureLoader.h
+++ b/Core/WICTextureLoader.h
@@ -30,11 +30,17 @@
#include <d3d11_1.h>
#include <stdint.h>
+#ifdef DXUT_EXPORT
+ #define DXUT_API __declspec(dllexport)
+#else
+ #define DXUT_API __declspec(dllimport)
+#endif
+
namespace DirectX
{
// Standard version
- HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice,
+ DXUT_API HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice,
_In_reads_bytes_(wicDataSize) const uint8_t* wicData,
_In_ size_t wicDataSize,
_Out_opt_ ID3D11Resource** texture,
@@ -42,7 +48,7 @@ namespace DirectX
_In_ size_t maxsize = 0
);
- HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice,
+ DXUT_API HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice,
_In_z_ const wchar_t* szFileName,
_Out_opt_ ID3D11Resource** texture,
_Out_opt_ ID3D11ShaderResourceView** textureView,
@@ -50,7 +56,7 @@ namespace DirectX
);
// Standard version with optional auto-gen mipmap support
- HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice,
+ DXUT_API HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice,
_In_opt_ ID3D11DeviceContext* d3dContext,
_In_reads_bytes_(wicDataSize) const uint8_t* wicData,
_In_ size_t wicDataSize,
@@ -59,7 +65,7 @@ namespace DirectX
_In_ size_t maxsize = 0
);
- HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice,
+ DXUT_API HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice,
_In_opt_ ID3D11DeviceContext* d3dContext,
_In_z_ const wchar_t* szFileName,
_Out_opt_ ID3D11Resource** texture,
@@ -68,7 +74,7 @@ namespace DirectX
);
// Extended version
- HRESULT CreateWICTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice,
+ DXUT_API HRESULT CreateWICTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice,
_In_reads_bytes_(wicDataSize) const uint8_t* wicData,
_In_ size_t wicDataSize,
_In_ size_t maxsize,
@@ -81,7 +87,7 @@ namespace DirectX
_Out_opt_ ID3D11ShaderResourceView** textureView
);
- HRESULT CreateWICTextureFromFileEx( _In_ ID3D11Device* d3dDevice,
+ DXUT_API HRESULT CreateWICTextureFromFileEx( _In_ ID3D11Device* d3dDevice,
_In_z_ const wchar_t* szFileName,
_In_ size_t maxsize,
_In_ D3D11_USAGE usage,
@@ -94,7 +100,7 @@ namespace DirectX
);
// Extended version with optional auto-gen mipmap support
- HRESULT CreateWICTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice,
+ DXUT_API HRESULT CreateWICTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice,
_In_opt_ ID3D11DeviceContext* d3dContext,
_In_reads_bytes_(wicDataSize) const uint8_t* wicData,
_In_ size_t wicDataSize,
@@ -108,7 +114,7 @@ namespace DirectX
_Out_opt_ ID3D11ShaderResourceView** textureView
);
- HRESULT CreateWICTextureFromFileEx( _In_ ID3D11Device* d3dDevice,
+ DXUT_API HRESULT CreateWICTextureFromFileEx( _In_ ID3D11Device* d3dDevice,
_In_opt_ ID3D11DeviceContext* d3dContext,
_In_z_ const wchar_t* szFileName,
_In_ size_t maxsize,
diff --git a/Core/dxerr.h b/Core/dxerr.h
index 39e348d..9616dea 100644
--- a/Core/dxerr.h
+++ b/Core/dxerr.h
@@ -25,7 +25,7 @@ extern "C" {
//--------------------------------------------------------------------------------------
// DXGetErrorString
//--------------------------------------------------------------------------------------
-const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr );
+DXUT_API const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr );
#define DXGetErrorString DXGetErrorStringW
@@ -33,7 +33,7 @@ const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr );
// DXGetErrorDescription has to be modified to return a copy in a buffer rather than
// the original static string.
//--------------------------------------------------------------------------------------
-void WINAPI DXGetErrorDescriptionW( _In_ HRESULT hr, _Out_cap_(count) WCHAR* desc, _In_ size_t count );
+void DXUT_API WINAPI DXGetErrorDescriptionW( _In_ HRESULT hr, _Out_cap_(count) WCHAR* desc, _In_ size_t count );
#define DXGetErrorDescription DXGetErrorDescriptionW
@@ -52,7 +52,7 @@ void WINAPI DXGetErrorDescriptionW( _In_ HRESULT hr, _Out_cap_(count) WCHAR* des
//
// Return: The hr that was passed in.
//--------------------------------------------------------------------------------------
-HRESULT WINAPI DXTraceW( _In_z_ const WCHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_opt_ const WCHAR* strMsg, _In_ bool bPopMsgBox );
+HRESULT DXUT_API WINAPI DXTraceW( _In_z_ const WCHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_opt_ const WCHAR* strMsg, _In_ bool bPopMsgBox );
#define DXTrace DXTraceW