프로젝트 추가
This commit is contained in:
153
proj.winrt/App.cpp
Normal file
153
proj.winrt/App.cpp
Normal file
@@ -0,0 +1,153 @@
|
||||
/****************************************************************************
|
||||
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
||||
Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md).
|
||||
|
||||
https://axmol.dev/
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
****************************************************************************/
|
||||
|
||||
#include "App.h"
|
||||
|
||||
#include "OpenGLESPage.h"
|
||||
|
||||
using namespace winrt;
|
||||
using namespace Windows::ApplicationModel;
|
||||
using namespace Windows::ApplicationModel::Activation;
|
||||
using namespace Windows::Foundation;
|
||||
using namespace Windows::Foundation::Collections;
|
||||
using namespace Windows::UI::Xaml::Media::Animation;
|
||||
using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::UI::Xaml::Controls;
|
||||
using namespace Windows::UI::Xaml::Controls::Primitives;
|
||||
using namespace Windows::UI::Xaml::Data;
|
||||
using namespace Windows::UI::Xaml::Input;
|
||||
using namespace Windows::UI::Xaml::Interop;
|
||||
using namespace Windows::UI::Xaml::Media;
|
||||
using namespace Windows::UI::Xaml::Navigation;
|
||||
using namespace AxmolAppWinRT;
|
||||
using namespace AxmolAppWinRT::implementation;
|
||||
|
||||
/// <summary>
|
||||
/// Creates the singleton application object. This is the first line of authored code
|
||||
/// executed, and as such is the logical equivalent of main() or WinMain().
|
||||
/// </summary>
|
||||
App::App()
|
||||
{
|
||||
Suspending({ this, &App::OnSuspending });
|
||||
Resuming({this, &App::OnResuming});
|
||||
|
||||
// Resuming({ this, &AppOnResuming });
|
||||
|
||||
#if defined _DEBUG && !defined DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
|
||||
UnhandledException([this](IInspectable const&, UnhandledExceptionEventArgs const& e)
|
||||
{
|
||||
if (IsDebuggerPresent())
|
||||
{
|
||||
auto errorMessage = e.Message();
|
||||
__debugbreak();
|
||||
}
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when the application is launched normally by the end user. Other entry points
|
||||
/// will be used such as when the application is launched to open a specific file.
|
||||
/// </summary>
|
||||
/// <param name="e">Details about the launch request and process.</param>
|
||||
void App::OnLaunched(LaunchActivatedEventArgs const& e)
|
||||
{
|
||||
Frame rootFrame{ nullptr };
|
||||
auto content = Window::Current().Content();
|
||||
if (content)
|
||||
{
|
||||
rootFrame = content.try_as<Frame>();
|
||||
}
|
||||
|
||||
// Do not repeat app initialization when the Window already has content,
|
||||
// just ensure that the window is active
|
||||
if (rootFrame == nullptr)
|
||||
{
|
||||
// Create a Frame to act as the navigation context and associate it with
|
||||
// a SuspensionManager key
|
||||
rootFrame = Frame();
|
||||
|
||||
rootFrame.NavigationFailed({ this, &App::OnNavigationFailed });
|
||||
|
||||
if (e.PreviousExecutionState() == ApplicationExecutionState::Terminated)
|
||||
{
|
||||
// Restore the saved session state only when appropriate, scheduling the
|
||||
// final launch steps after the restore is complete
|
||||
}
|
||||
}
|
||||
|
||||
if (e.PrelaunchActivated() == false)
|
||||
{
|
||||
if (rootFrame.Content() == nullptr)
|
||||
{
|
||||
// When the navigation stack isn't restored navigate to the first page,
|
||||
// configuring the new page by passing required information as a navigation
|
||||
// parameter
|
||||
rootFrame.Content(winrt::make<OpenGLESPage>(&mOpenGLES));
|
||||
//rootFrame.Navigate(xaml_typename<AxmolAppWinRT::OpenGLESPage>(), box_value(e.Arguments()));
|
||||
mPage = rootFrame.Content();
|
||||
}
|
||||
// Place the frame in the current Window
|
||||
Window::Current().Content(rootFrame);
|
||||
// Ensure the current window is active
|
||||
Window::Current().Activate();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when application execution is being suspended. Application state is saved
|
||||
/// without knowing whether the application will be terminated or resumed with the contents
|
||||
/// of memory still intact.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the suspend request.</param>
|
||||
/// <param name="e">Details about the suspend request.</param>
|
||||
void App::OnSuspending([[maybe_unused]] IInspectable const& sender, [[maybe_unused]] SuspendingEventArgs const& e)
|
||||
{
|
||||
// Save application state and stop any background activity
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when application execution is being resumed.
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the resume request.</param>
|
||||
/// <param name="args">Details about the resume request.</param>
|
||||
void App::OnResuming(IInspectable const& sender, IInspectable const& args)
|
||||
{
|
||||
(void)sender; // Unused parameter
|
||||
(void)args; // Unused parameter
|
||||
|
||||
if (mPage)
|
||||
mPage.as<OpenGLESPage>()->SetVisibility(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when Navigation to a certain page fails
|
||||
/// </summary>
|
||||
/// <param name="sender">The Frame which failed navigation</param>
|
||||
/// <param name="e">Details about the navigation failure</param>
|
||||
void App::OnNavigationFailed(IInspectable const&, NavigationFailedEventArgs const& e)
|
||||
{
|
||||
//throw hresult_error(E_FAIL, hstring(L"Failed to load Page ") + e.SourcePageType().Name);
|
||||
}
|
||||
47
proj.winrt/App.h
Normal file
47
proj.winrt/App.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/****************************************************************************
|
||||
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
||||
Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md).
|
||||
|
||||
https://axmol.dev/
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
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 "pch.h"
|
||||
|
||||
#include "App.xaml.g.h"
|
||||
#include "OpenGLES.h"
|
||||
|
||||
using namespace winrt;
|
||||
|
||||
namespace winrt::AxmolAppWinRT::implementation
|
||||
{
|
||||
struct App : AppT<App>
|
||||
{
|
||||
App();
|
||||
void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs const&);
|
||||
void OnSuspending(IInspectable const&, Windows::ApplicationModel::SuspendingEventArgs const&);
|
||||
void OnResuming(IInspectable const&, IInspectable const&);
|
||||
void OnNavigationFailed(IInspectable const&, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs const&);
|
||||
Windows::Foundation::IInspectable mPage;
|
||||
OpenGLES mOpenGLES;
|
||||
};
|
||||
}
|
||||
3
proj.winrt/App.idl
Normal file
3
proj.winrt/App.idl
Normal file
@@ -0,0 +1,3 @@
|
||||
namespace AxmolAppWinRT
|
||||
{
|
||||
}
|
||||
12
proj.winrt/App.xaml
Normal file
12
proj.winrt/App.xaml
Normal file
@@ -0,0 +1,12 @@
|
||||
<Application
|
||||
x:Class="AxmolAppWinRT.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:AxmolAppWinRT">
|
||||
|
||||
<Application.Resources>
|
||||
|
||||
<x:String x:Key="AppName">Pinball</x:String>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
BIN
proj.winrt/Content/LockScreenLogo.scale-200.png
LFS
Normal file
BIN
proj.winrt/Content/LockScreenLogo.scale-200.png
LFS
Normal file
Binary file not shown.
BIN
proj.winrt/Content/SplashScreen.scale-200.png
LFS
Normal file
BIN
proj.winrt/Content/SplashScreen.scale-200.png
LFS
Normal file
Binary file not shown.
BIN
proj.winrt/Content/Square150x150Logo.scale-200.png
LFS
Normal file
BIN
proj.winrt/Content/Square150x150Logo.scale-200.png
LFS
Normal file
Binary file not shown.
BIN
proj.winrt/Content/Square44x44Logo.scale-200.png
LFS
Normal file
BIN
proj.winrt/Content/Square44x44Logo.scale-200.png
LFS
Normal file
Binary file not shown.
BIN
proj.winrt/Content/Square44x44Logo.targetsize-24_altform-unplated.png
LFS
Normal file
BIN
proj.winrt/Content/Square44x44Logo.targetsize-24_altform-unplated.png
LFS
Normal file
Binary file not shown.
BIN
proj.winrt/Content/StoreLogo.png
LFS
Normal file
BIN
proj.winrt/Content/StoreLogo.png
LFS
Normal file
Binary file not shown.
BIN
proj.winrt/Content/Wide310x150Logo.scale-200.png
LFS
Normal file
BIN
proj.winrt/Content/Wide310x150Logo.scale-200.png
LFS
Normal file
Binary file not shown.
43
proj.winrt/Package.appxmanifest
Normal file
43
proj.winrt/Package.appxmanifest
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
|
||||
<Identity Name="fe5bbe02-0ca6-4dc3-ab15-94260df03d68" Publisher="CN=axmol-ci" Version="1.0.0.0" />
|
||||
<mp:PhoneIdentity PhoneProductId="fe5bbe02-0ca6-4dc3-ab15-94260df03d68" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
|
||||
<Properties>
|
||||
<DisplayName>Pinball</DisplayName>
|
||||
<PublisherDisplayName>Microsoft Open Technologies, Inc.</PublisherDisplayName>
|
||||
<Logo>Content\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10069.0" MaxVersionTested="10.0.10069.0" />
|
||||
</Dependencies>
|
||||
<Resources>
|
||||
<Resource Language="x-generate" />
|
||||
</Resources>
|
||||
<Applications>
|
||||
<Application Id="App"
|
||||
Executable="$targetnametoken$.exe"
|
||||
EntryPoint="Pinball.App">
|
||||
<uap:VisualElements
|
||||
DisplayName="Pinball"
|
||||
Square150x150Logo="Content\Square150x150Logo.png"
|
||||
Square44x44Logo="Content\Square44x44Logo.png"
|
||||
Description="Pinball"
|
||||
BackgroundColor="#464646">
|
||||
<uap:DefaultTile Wide310x150Logo="Content\Wide310x150Logo.png">
|
||||
<uap:ShowNameOnTiles>
|
||||
<uap:ShowOn Tile="square150x150Logo" />
|
||||
<uap:ShowOn Tile="wide310x150Logo" />
|
||||
</uap:ShowNameOnTiles>
|
||||
</uap:DefaultTile>
|
||||
<uap:SplashScreen Image="Content\SplashScreen.png" />
|
||||
<uap:InitialRotationPreference>
|
||||
<uap:Rotation Preference="landscape" />
|
||||
<uap:Rotation Preference="landscapeFlipped" />
|
||||
</uap:InitialRotationPreference>
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
</Capabilities>
|
||||
</Package>
|
||||
1
proj.winrt/pch.cpp
Normal file
1
proj.winrt/pch.cpp
Normal file
@@ -0,0 +1 @@
|
||||
#include "pch.h"
|
||||
15
proj.winrt/pch.h
Normal file
15
proj.winrt/pch.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
#include <windows.h>
|
||||
#include <unknwn.h>
|
||||
#include <restrictederrorinfo.h>
|
||||
#include <hstring.h>
|
||||
#include <winrt/Windows.Foundation.h>
|
||||
#include <winrt/Windows.Foundation.Collections.h>
|
||||
#include <winrt/Windows.ApplicationModel.Activation.h>
|
||||
#include <winrt/Windows.UI.Xaml.h>
|
||||
#include <winrt/Windows.UI.Xaml.Controls.h>
|
||||
#include <winrt/Windows.UI.Xaml.Controls.Primitives.h>
|
||||
#include <winrt/Windows.UI.Xaml.Data.h>
|
||||
#include <winrt/Windows.UI.Xaml.Interop.h>
|
||||
#include <winrt/Windows.UI.Xaml.Markup.h>
|
||||
#include <winrt/Windows.UI.Xaml.Navigation.h>
|
||||
Reference in New Issue
Block a user