首页 \ 问答 \ 适用于DirectX环境的Windows Phone 8.1模拟器(Windows Phone 8.1 emulator for DirectX landscape)

适用于DirectX环境的Windows Phone 8.1模拟器(Windows Phone 8.1 emulator for DirectX landscape)

2014年7月16日更新:我已将SharpDX“MiniCube”示例项目转换为Universal 8.1项目。 它是100%独立的。 它将证明这个问题。 信息中包含“READ ME.txt”文件。 您可以在这里下载:

下载SharpDX MiniCube Universal 8.1项目


我的问题是Visual Studio 2013中的Windows Phone 8.1模拟器正在横向显示横向模式。 图像是风景并且看起来正确,但是它旋转了90度,坐在一端并且从显示器的顶部开始。 这些图片向您展示我的意思:

肖像 景观

您可以单击图像以全尺寸查看它们。

就应用而言,它处于横向模式,并且所有触摸处理都表现正常,就好像它正确显示一样。 它只是在一端旋转的模拟器中显示出来。

这是一个C#项目,使用SharpDX(C#的DirectX包装器)。 我不知道这个问题是否会在真实设备上发生; 我一个都没有。 我显然甚至不能考虑发布我的应用程序而不知道它是否应该在真实设备上正常运行。

我的代码中没有任何花哨的东西。 我使用SharpDX样本中使用的“CommonDX”源代码,未经修改:

https://github.com/sharpdx/SharpDX-Samples/tree/master/WindowsAppStore81/CommonDX

在WinRT(计算机/平板电脑)版本中,相同的源代码在模拟器和真实设备上都能正常运行。

如果有人对此有所了解,请告诉我你能做什么。 谢谢!


2014年7月16日更新:我出去买了诺基亚Lumia 520并将其更新到Windows 8.1。 同样的问题也发生在真实设备上。 唯一的区别是它可以调整完整的旋转宽度以适应显示器,而不是从顶部运行。

我还应该补充一点,我使用的是SharpDX 2.6.2 DLL。

正如我所说,我使用的是与Windows App Store 8.1项目(用于计算机和平板电脑)相同的源代码,并且它在那里完美运行。 不过,我必须为Windows Phone 8.1做一个小改动。 在CommonDX源代码中,在文件SwapChainTargetBase.cs中,对swapChain.ResizeBuffers()的调用会生成SharpDXException异常(HRESULT 0x887A0004 DXGI_ERROR_UNSUPPORTED)。

每当屏幕尺寸发生变化时都会发生这种情况,当您倾斜设备以更改方向时,会发生这种情况。 为了解决这个问题,我只需处理当前的“swapChain”并让现有代码创建一个新代码而不是调整旧代码。 此更改不会导致此处发生的问题。

我检查了SharpDX示例中的示例代码,但截止到目前为止,没有一个示例似乎适用于Windows Phone 8.1。 他们有“WindowsAppStore81”(PC /平板电脑)和“WindowsPhone8”样本,但没有“WindowsPhone81”,也没有“WindowsUniversal81”。

我无论如何都不是DirectX大师。 我正在制作应用程序,而不是努力让我的工具为我工作。 我在所有其他平台上使用OpenGL,没有任何问题。 但无论如何,如果我尝试的话,我无法使横向视图从显示屏顶部旋转。 您可以在屏幕截图中看到我的应用程序知道它在横向视图中,并且正在渲染横向缓冲区。 无论是什么导致这个问题,它都在我自己的源代码之外。

我的应用程序功能齐全,在我手中运行Windows Phone 8.1的实际设备上,我无法释放它,因为它无法正确显示横向视图。 我似乎没有办法改变这种状况。

有没有人甚至为Windows Phone 8.1建立了一个成功的SharpDX项目,一个在纵向和横向都可以工作的项目?

最后一点:为什么微软不允许支持OpenGL,然后不包括对C#语言的DirectX支持? 如果不是SharpDX,我们都会完全搞砸了。


July 16, 2014 update: I have converted the SharpDX "MiniCube" sample project to a Universal 8.1 project. It is 100% self-contained. It will demonstrate this issue. There is a "READ ME.txt" file included with information. You can download it here:

Download SharpDX MiniCube Universal 8.1 project


My issue is that the Windows Phone 8.1 emulator in Visual Studio 2013 is displaying the landscape mode sideways. The image is landscape and looks correct, but it's rotated 90 degrees, sitting on one end and running off the top of the display. Here are pictures to show you what I mean:

Portrait Landscape

You can click the images to see them in full size.

As far as the app is concerned, it is in landscape mode, and all handling of touches behaves correctly, as though it is being displayed properly. It simply shows up in the emulator rotated on one end.

This is a C# project, using SharpDX (a DirectX wrapper for C#). I don't know if this issue will occur on a real device or not; I do not have one. I obviously can't even consider releasing my app without knowing if this should behave properly on a real device.

I don't do anything fancy in my code. I use the "CommonDX" source code used in the SharpDX samples, unmodified:

https://github.com/sharpdx/SharpDX-Samples/tree/master/WindowsAppStore81/CommonDX

The same source code behaves properly in the WinRT (computer/tablet) version, both in the simulator and on a real device.

If anyone knows anything about this, please tell me whatever you can. Thanks!


July 16, 2014 update: I went out and bought a Nokia Lumia 520 and updated it to Windows 8.1. This same issue occurs on a real device as well. The only difference is that it squishes the full rotated width to fit in the display, rather than running off the top.

I should also add that I am using the SharpDX 2.6.2 DLLs.

As I stated, I am using the same source code that I use for the Windows App Store 8.1 project (for computers and tablets), and it all works perfectly there. There was one small change I had to make for Windows Phone 8.1 though. In the CommonDX source code, in the file SwapChainTargetBase.cs, the call to swapChain.ResizeBuffers() generates a SharpDXException exception (HRESULT 0x887A0004 DXGI_ERROR_UNSUPPORTED).

This occurs whenever the screen dimensions change, which of course occurs when you tilt the device to change the orientation. To get around this problem, I simply dispose the current "swapChain" and let the existing code create a new one instead of resizing the old one. This change would not cause the issue that is happening here.

I checked the SharpDX samples for sample code, but as of this date, none of the samples appear to be for Windows Phone 8.1. They have "WindowsAppStore81" (PC/tablet), and "WindowsPhone8" samples, but no "WindowsPhone81", nor "WindowsUniversal81".

I'm no DirectX guru by any stretch. I'm into making apps, not fighting to make my tools work for me. And I use OpenGL on all other platforms, with no problems. But in any case, I couldn't cause the landscape view to rotate off the top of the display if I tried. You can see in the screenshot that my app knows it's in landscape view, and is rendering a landscape buffer. Whatever is causing this issue, it's outside of my own source code.

My app is fully functional, on an actual device running Windows Phone 8.1 in the palm of my hand, and I can't release it, because it won't display the landscape view properly. And there doesn't seem to be a thing I can do to change that.

Has anyone even built a successful SharpDX project for Windows Phone 8.1, one that works in portrait and landscape both?

One last note: Why the heck does Microsoft not allow support for OpenGL, and then not include support for DirectX either for the C# language? If it wasn't for SharpDX, we'd all be totally screwed.


原文:
更新时间:2022-06-27 22:06

最满意答案

我刚遇到同样的问题,但找到了解决方案。

如果您尝试在开发模式下使用“http://127.0.0.1:3000”打开浏览器,而不是“http:// localhost:3000”,则应该面临同样的问题。

在我的情况下,问题是由于在我的View文件中,我使用“request.domain”,如果请求是以类似IP的格式(即“http://127.0.0.1:50752”)返回,则返回nil。

因此,如果你在辅助方法的视图中有某个地方,你有这样的东西

link_to "Click me", :host => subdomain + "." + request.domain + request.port_string

您可以将其更改为使用助手方法,如下所示:

link_to "Click me", :host => with_host(subdomain)

和帮手一样如下:

  def with_host(subdomain)
    if request.domain.present?
      subdomain + "." + request.domain + request.port_string
    end
  end

这是对我有用的最简单的解决方案。 也许,你有类似的东西。


I just faced te same problem, but found a solution.

If you try to open your browser with "http://127.0.0.1:3000" in development mode, instead of "http://localhost:3000", you should face the same problem.

In my case the problem was caused, because in my View file I used "request.domain" that returns nil if request is given in IP-like format, i.e. "http://127.0.0.1:50752".

Therefore, if somewhere in your view of helper methods you have something like this

link_to "Click me", :host => subdomain + "." + request.domain + request.port_string

you can change it to using helper method, like that:

link_to "Click me", :host => with_host(subdomain)

And helper like following:

  def with_host(subdomain)
    if request.domain.present?
      subdomain + "." + request.domain + request.port_string
    end
  end

That's the easiest solution that worked for me. Perhaps, you have something similar.

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)