diff --git a/Frameworks/CoreGraphics/D2DWrapper.h b/Frameworks/CoreGraphics/D2DWrapper.h new file mode 100644 index 0000000000..11caaf6fd9 --- /dev/null +++ b/Frameworks/CoreGraphics/D2DWrapper.h @@ -0,0 +1,24 @@ +//****************************************************************************** +// +// Copyright (c) Microsoft. All rights reserved. +// +// This code is licensed under the MIT License (MIT). +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +//****************************************************************************** + +#pragma once + +#include +#import +#import +#include + +Microsoft::WRL::ComPtr _GetD2DFactoryInstance(); \ No newline at end of file diff --git a/Frameworks/CoreGraphics/D2DWrapper.mm b/Frameworks/CoreGraphics/D2DWrapper.mm new file mode 100644 index 0000000000..952d55fb31 --- /dev/null +++ b/Frameworks/CoreGraphics/D2DWrapper.mm @@ -0,0 +1,27 @@ +//****************************************************************************** +// +// Copyright (c) Microsoft. All rights reserved. +// +// This code is licensed under the MIT License (MIT). +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +//****************************************************************************** + +#import "D2DWrapper.h" +#import + +using namespace Microsoft::WRL; + +// Helper for creating a D2DFactory +ComPtr _CreateD2DFactoryInstance() { + ComPtr d2dFactory; + THROW_IF_FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, __uuidof(ID2D1Factory), &d2dFactory)); + return d2dFactory; +} \ No newline at end of file diff --git a/build/CoreGraphics/lib/CoreGraphicsLib.vcxproj b/build/CoreGraphics/lib/CoreGraphicsLib.vcxproj index 00db0c0b24..2e773c0ff2 100644 --- a/build/CoreGraphics/lib/CoreGraphicsLib.vcxproj +++ b/build/CoreGraphics/lib/CoreGraphicsLib.vcxproj @@ -1,4 +1,4 @@ - + @@ -55,6 +55,10 @@ + + + + {6293444C-1461-4CC7-9634-44AB90B8BBC3} @@ -115,4 +119,4 @@ - + \ No newline at end of file