Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

Support D2D, DWrite and WIC on WP 8.1 #334

Closed
IndieViking opened this issue Apr 6, 2014 · 8 comments
Closed

Support D2D, DWrite and WIC on WP 8.1 #334

IndieViking opened this issue Apr 6, 2014 · 8 comments

Comments

@IndieViking
Copy link

Support new APIs on Windows Phone 8.1

  • Direct2D
  • DirectWrite
  • WIC
  • HLSL shader compiler

Source:
http://blogs.msdn.com/b/shawnhar/archive/2014/04/03/windows-phone-8-1.aspx

@ArtiomCiumac
Copy link
Contributor

Good point. It looks like until all WP8 devices will be updated to WP8.1, we will have to maintain 2 WP builds - one for WP8 and another for WP8.1, so this will take some time.

@mrvux
Copy link
Contributor

mrvux commented Apr 15, 2014

As a side note, I just upgraded my phone to WP8.1, using Win8Release build works pretty much out of the box for universal app (tested as WinRT and on Nokia Lumia). Here is what I tried so far:

  • Direct2D RenderTarget from swapchain and draw some shapes
  • Create DirectWrite Factory and a textlayout, draw using Direct2D
  • Compile a shader on the fly with D3DCompiler (you need DIRECTX11_2 flag for the build so it requests the right version of the compiler)
  • WIC Imaging factory creation was failing, due to calling wrong dll in SharpDX.Utilities (fixed in Small bug fix for CoCreateInstanceFromApp #347 )

So actually it seems like everything should be quite faster than expected, and that we can just use the winrt build.
If I find some issues I'll report of fix them if I can find it, and post a few examples.

@xoofx
Copy link
Member

xoofx commented Apr 15, 2014

Thanks for the feedback! Yes the port should be easy. The only possible incompatible things I can think of are the SharpDX NativeFile/Stream that I suspect to use different Dll imports

@ArtiomCiumac
Copy link
Contributor

Please be patient :) I'm working on it...

@mrvux
Copy link
Contributor

mrvux commented Apr 15, 2014

Glad to help still ;)

Also did some tests with NativeFile (Windows Phone 8.1).

Using kernel32.dll will indeed throw an exception when trying to call API and fail certification test
Replacing by KernelBase.dll works on the physical device, but also fails certification.

To pass tests for application (SharpDX core in Windows Phone 8.1, D2D/D3D libraries have no issue):
For all API calls in NativeFile.cs

  • replacing dll name by "api-ms-win-core-file-l1-2-0.dll" works and pass the test.
  • Only exception to this is GetFileInformationByHandleEx , dll name is : api-ms-win-core-file-l2-1-0.dll

In utilities:

  • CloseHandle : api-ms-win-core-handle-l1-1-0.dll
  • LoadLibrary_ (LoadPackagedLibrary) : PhoneAppModelHost.dll
  • GetProcAddress : api-ms-win-core-libraryloader-l1-1-1.dll

In ResultDescriptor:

  • FormatMessageW : api-ms-win-core-localization-l1-2-0.dll

All that changes also pass the test on a standard store App (Win8.1), of course except an annoying one: LoadPackagedLibrary pass on kernel32.dll in store App, but need PhoneAppModelHost.dll on windows phone.

@ArtiomCiumac
Copy link
Contributor

Experimental support for Windows Phone 8.1 has been added in the wp81 branch. Basically it is nearly the same as WinRT platform, except some small details.

  • The changeset 55b21a4 adds support for WP8.1.
  • The changeset 1714602 fixes the issue with LoadLibrary - now it passes the certification test successfully.

I haven't tested this much yet - more work needs to be done, also some basic samples need to be added.

Feel free to share any thoughts about this.

@ArtiomCiumac
Copy link
Contributor

A new sample has been added in ac44b0c. Looks like WP8.1 is closer to WinRT than to WP8.

@xoofx xoofx closed this as completed Oct 31, 2014
@alexsorokoletov
Copy link

Guys, I wonder if you can help me with WIC and WP8.1
WicRenderTarget ctor crashes on devices, but not on emulators.
mono/CocosSharp#260

Appreciate any help or advise.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants