-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[W10] CoreApplication project template (VS2015) & fixes #5615
Conversation
Another template in the VS2015 folder @nkast ? |
The template is similar to the Windows 8.1 template for CoreApplication in VS2013 but for W10 which was missing. |
So how is it different to the existing Windows 10 UWP template in the VS2015 folder? In other words, why new instead of update? |
The existing template uses the XAML framework and the new template runs on a much slimmer CoreApplication framework. Both types of apps have their pros and cons. XAML for example let's you mix XAML control on top of the backbuffer, ADvertising libraries for example. |
986f65d
to
25bf072
Compare
25bf072
to
83cf31e
Compare
83cf31e
to
2280200
Compare
2280200
to
0c67e5a
Compare
0c67e5a
to
37d67d6
Compare
37d67d6
to
90a6168
Compare
I agree, we should have both XAML and D3D templates for Win10, so I would welcome this addition. |
I don't see how it's related to this PR but since you mention it, I welcome the decision to keep W8.1 for at least one more release. MG needs to be able to claim that it had a working W8.1 version, the platform was more or less broken on the previous releases. |
Except @nkast that Win8.1 has many outstanding issues, all of which have not been resolved and almost nothing has been done for the platform since 3.6. The fact even MS has dropped support should merit dropping it from 3.7 in favour of a newer version of SharpDX |
90a6168
to
3ac03f9
Compare
Yo @nkast |
I fixed the conflict. This should work now. |
Thanks @nkast for the fast response. |
Remember that you need to combine it with #5613 for a runtime test to work. |
When tested with Win10 / VS2107 and SDK 16299, it crashes on this line 213 of InputEvents.cs Suggest adding a "Window.Current != null" check around this code. (preferably refactored in a new function as it's called from 3 functions) Otherwise, this code runs perfectly. Fantastic work @nkast |
Woot, then imho @tomspilman this is ready to merge now. Tested both D3D and XAML projects using the updates and it's all good. |
ecfe00f
to
4aff788
Compare
I rebased the PR to fix the conflict and include #5613. As for the DDReaper Should I push the change in this PR? |
I would recommend to add that null check, as in testing with 16299, it caused the game to halt |
It relates to CoreApplication. |
Both projects use directx, this would be confusing. It sould be called Core or Lightweight or something like that and the other project XAML. |
4aff788
to
23f0b22
Compare
I named it Core to distinguish it from the "Windows Universal" (XAML) project. |
I made the change to InputEvents.cs and merged it into #23f0b22 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes now all work in release & debug modes for all UWP targets
Over to you @tomspilman , this is ready to go. Will let you make the call on naming. |
@@ -1,8 +1,8 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Project"> | |||
<TemplateData> | |||
<Name>MonoGame Windows 10 Universal Project</Name> | |||
<Description>A MonoGame game project for Windows 10 UWP.</Description> | |||
<Name>MonoGame Windows 10 Universal (XAML) Project</Name> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So as to distinguish between the two templates, one being XAML and the other being a core / D3D application.
Just saying Win 10 Universal alone isn't enough to describe what it is
To be clear this PR just adds support for running Windows 10 UWP apps that don't support XAML which are a little faster and use a little less memory. Early on we decided we didn't need to support this... but i'm good with adding it now. |
Merging. Thanks @nkast |
Will get on the 2017 PR asap, hopefully before the weekend. |
Thanks @KonajuGames ! |
I get wrong backbuffer size on startup after merging this PR. (More info in #6129) |
I think size changed event doesn't get fired at startup like it did before. https://github.com/MonoGame/MonoGame/pull/5615/files#diff-4cee1f2a28f7ffd8b6168e8e93e9a840L129 |
The initialization code should create the backbuffer in the right size even if nothing get's resized. |
@Jure-BB Can you remove the following lines and see what happens? |
I did a mini test. Set breakpoint inside UAPGameWindow.cs In windowed mode I get white area inside game windows as backbuffer is not the same size as viewbounds of the window. |
Haven't dug deep into #5555, but this isn't affected by width/height ratio, if that's what you're asking. Width is greater than height in my tests. I'll try to create a sample project. |
That's another issue, #5914. Although the actual fix would be to resize the window as we do on other platforms. |
Can I match backbuffer size to be the same as window viewbounds on startup without modifying MG? |
I suspect that MG starts with 800x480 but the window stays the same, right? |
Similar. I try to restore last used size, but the window stays the same. |
This was actually messing my code in a lot of places. So I disabled any resolution changes, by always overriding resolution to Game.Window.Bounds for UWP platform. Thanks @nkast for clarification! |
Another idea, |
That sounds like a good idea for PR. It would be nice, if UWP version of MG behaved similar to other platforms. I'll probably have a look at it when I'm closer to release. |
* W10 CoreApplication project Template * Support for W10 CoreApplication
(requires fix #5613)
Related to #5915