Skip to content

Commit

Permalink
working directxtex (unofficial)
Browse files Browse the repository at this point in the history
  • Loading branch information
robmikh committed Sep 29, 2019
1 parent c459667 commit efe6a6f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Win32CaptureSample/SampleWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void SampleWindow::CreateControls(HINSTANCE instance)

// Create current snapshot button
HWND currentSnapshotButtonHwnd = CreateWindowW(WC_BUTTON, L"Snapshot Current Capture",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON | WS_DISABLED,
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,
10, 160, 200, 30, m_window, nullptr, instance, nullptr);
WINRT_VERIFY(currentSnapshotButtonHwnd);

Expand Down
4 changes: 1 addition & 3 deletions Win32CaptureSample/SimpleCapture.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "pch.h"
#include "SimpleCapture.h"
//#include <DirectXTex.h>
#include <DirectXTex.h>

namespace winrt
{
Expand Down Expand Up @@ -113,12 +113,10 @@ void SimpleCapture::OnFrameArrived(winrt::Direct3D11CaptureFramePool const& send

void SimpleCapture::TakeSnapshot(winrt::com_ptr<ID3D11Texture2D> const& frame)
{
/*
DirectX::ScratchImage im;
winrt::check_hresult(DirectX::CaptureTexture(GetDXGIInterfaceFromObject<ID3D11Device>(m_device).get(),
m_d3dContext.get(), frame.get(), im));
const auto& realImage = *im.GetImage(0, 0, 0);
winrt::check_hresult(DirectX::SaveToWICFile(realImage, DirectX::WIC_FLAGS_NONE,
GUID_ContainerFormatPng, L"output.png"));
*/
}
8 changes: 4 additions & 4 deletions Win32CaptureSample/Win32CaptureSample.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>Windowscodecs.lib;windowsapp.lib;dwmapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Windowscodecs.lib;windowsapp.lib;dwmapi.lib;D:\Robert\repos\DirectXTex\DirectXTex\Bin\Desktop_2019_Win10\ARM64\Debug\DirectXTex.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand Down Expand Up @@ -191,7 +191,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>Windowscodecs.lib;windowsapp.lib;dwmapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Windowscodecs.lib;windowsapp.lib;dwmapi.lib;D:\Robert\repos\DirectXTex\DirectXTex\Bin\Desktop_2019_Win10\ARM64\Debug\DirectXTex.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down Expand Up @@ -227,16 +227,16 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Microsoft.Windows.ImplementationLibrary.1.0.190716.2\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\packages\Microsoft.Windows.ImplementationLibrary.1.0.190716.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
<Import Project="..\packages\directxtex_desktop_win10.2019.8.23.1\build\native\directxtex_desktop_win10.targets" Condition="Exists('..\packages\directxtex_desktop_win10.2019.8.23.1\build\native\directxtex_desktop_win10.targets')" />
<Import Project="..\packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets')" />
<Import Project="..\packages\directxtex_desktop_win10.2019.9.28\build\native\directxtex_desktop_win10.targets" Condition="Exists('..\packages\directxtex_desktop_win10.2019.9.28\build\native\directxtex_desktop_win10.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Windows.ImplementationLibrary.1.0.190716.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.ImplementationLibrary.1.0.190716.2\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
<Error Condition="!Exists('..\packages\directxtex_desktop_win10.2019.8.23.1\build\native\directxtex_desktop_win10.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\directxtex_desktop_win10.2019.8.23.1\build\native\directxtex_desktop_win10.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Windows.CppWinRT.2.0.190730.2\build\native\Microsoft.Windows.CppWinRT.targets'))" />
<Error Condition="!Exists('..\packages\directxtex_desktop_win10.2019.9.28\build\native\directxtex_desktop_win10.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\directxtex_desktop_win10.2019.9.28\build\native\directxtex_desktop_win10.targets'))" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion Win32CaptureSample/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="directxtex_desktop_win10" version="2019.8.23.1" targetFramework="native" />
<package id="directxtex_desktop_win10" version="2019.9.28" targetFramework="native" />
<package id="Microsoft.Windows.CppWinRT" version="2.0.190730.2" targetFramework="native" />
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.190716.2" targetFramework="native" />
</packages>

0 comments on commit efe6a6f

Please sign in to comment.