Comments (3)
In the case of WinRT - the issue is caused by the fact that the Toolkit subscribes to SizeChagned event of the SwapChainBackgroundPanel before it is loaded. When the control is loaded and positioned during the layout pass - its size changes and the SizeChanged event is fired, leading to a backbuffer resize even when the game was not displayed yet.
For WinRT we can check if the control is loaded (by checking that either of ActualWidth or ActualHeight are not zero?) and if not - subscribe to the Loaded event and initialize the game in its handler, or load it immediately otherwise.
WP8 platform has also issues with what and when gets loaded - discussed here: http://www.sharpdx.org/forum/5-api-usage/3401-drawingsurfacebackgroundgrid-vs-drawingsurface-on-windows-phone-8-wp8#3953
On WP8 this behavior causes incorrect sizing of the game - as the control size is not known during the initialization - the image gets stretched (for example, the backbuffer size is 800x480, while the WP8 surface size is 480x800).
from sharpdx.
Back to requirements:
- We want to render to whatever is the resolution of the device: We should specify a PreferedBackBufferWidth/Height to 0 and let the system pick a valid resolution for the container surface.
- We want to specify a specific resolution, and let the rendering be stretched by the container surface. In case the container surface is resize, we should update the specific resolution according to the ratio of the resize
Currently this is not really the case: it is half of both with an invalid mix between fixed size and variable size.
Are these requirements fine? Any other ideas?
If we settle on some behavior before 2.5, I will try to look if It can be fixed for this version.
from sharpdx.
I am not sure about the second requirement - I suppose if developer has specified some fixed backbuffer size - it should not be changed. For example, it may be required to save backbuffer contents to a image - so the size should not be changed unexpectedly. Is it worth to have some flag that can enable or disable the automatic resizing behavior? (this is now implemented in SharpDXElement for WPF platform).
What do you think?
from sharpdx.
Related Issues (20)
- Unable to create instances on Windows 7 (up to date)
- Function mapping guideline question HOT 2
- Missing trigger detection on Nyko Playpad Pro
- how can i create SharpDX.Direct2D1.Factory4? HOT 2
- Add DXCompiler HOT 5
- Disable MSDN Documentation Provider HOT 1
- Unity IL2Cpp throw System.NotImplementedException HOT 2
- How to add customized ViewCube?
- CallbackBase.Release() - Null reference exception
- .NET Core Support
- AudioProcessorBase.LockForProcess method is not virtual
- DirectInput.GetDevices(DeviceType deviceType, DeviceEnumerationFlags deviceEnumFlags) takes very long time
- texture size is reported wrong HOT 3
- Question about returning unsigned long in Interfaces.cs
- One cannot pass NULL to MapSubresource for the parameter D3D11_MAPPED_SUBRESOURCE *pMappedResource HOT 2
- Bug in Mapping.xml file? HOT 1
- Question about memory
- Error in 4.2 version that not was in 4.0.1 version
- Matrix3x2.ScaleVector calculation is incorrect for rotated transforms
- New Managed DirectX bindings HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharpdx.