RetroArch
uwp_main.h
Go to the documentation of this file.
1 /* RetroArch - A frontend for libretro.
2  * Copyright (C) 2018 - Krzysztof HaƂadyn
3  *
4  * RetroArch is free software: you can redistribute it and/or modify it under the terms
5  * of the GNU General Public License as published by the Free Software Found-
6  * ation, either version 3 of the License, or (at your option) any later version.
7  *
8  * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10  * PURPOSE. See the GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License along with RetroArch.
13  * If not, see <http://www.gnu.org/licenses/>.
14  */
15 
16 #pragma once
17 
18 #include "uwp_main.h"
19 
20 namespace RetroArchUWP
21 {
22  // Main entry point for our app. Connects the app with the Windows shell and handles application lifecycle events.
23  ref class App sealed : public Windows::ApplicationModel::Core::IFrameworkView
24  {
25  public:
26  App();
27 
28  // IFrameworkView methods.
29  virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
30  virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
31  virtual void Load(Platform::String^ entryPoint);
32  virtual void Run();
33  virtual void Uninitialize();
34 
35  protected:
36  // Application lifecycle event handlers.
37  void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
38  void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
39  void OnResuming(Platform::Object^ sender, Platform::Object^ args);
40 
41  void OnBackRequested(Platform::Object^ sender, Windows::UI::Core::BackRequestedEventArgs^ args);
42 
43  // Window event handlers.
44  void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
45  void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
46  void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
47  void OnWindowActivated(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowActivatedEventArgs^ args);
48  void OnKey(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
49  void OnPointer(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
50 
51  // DisplayInformation event handlers.
52  void OnDpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
53  void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
54  void OnDisplayContentsInvalidated(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
55 
56  void OnPackageInstalling(Windows::ApplicationModel::PackageCatalog^ sender, Windows::ApplicationModel::PackageInstallingEventArgs^ args);
57 
58  public:
59  bool IsInitialized() { return m_initialized; }
60  bool IsWindowClosed() { return m_windowClosed; }
61  bool IsWindowVisible() { return m_windowVisible; }
62  bool IsWindowFocused() { return m_windowFocused; }
63  bool CheckWindowResized() { bool resized = m_windowResized; m_windowResized = false; return resized; }
64  void SetWindowResized() { m_windowResized = true; }
65  static App^ GetInstance() { return m_instance; }
66 
67  private:
73  static App^ m_instance;
74  };
75 }
76 
77 ref class Direct3DApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
78 {
79 public:
80  virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView();
81 };
bool IsWindowClosed()
Definition: uwp_main.h:60
bool IsWindowFocused()
Definition: uwp_main.h:62
bool m_windowClosed
Definition: uwp_main.h:69
bool m_windowFocused
Definition: uwp_main.h:71
static App m_instance
Definition: uwp_main.h:73
const char * entryPoint
Definition: Hlsl.FromFile.cpp:45
bool m_initialized
Definition: uwp_main.h:68
bool IsInitialized()
Definition: uwp_main.h:59
Definition: uwp_main.h:20
static App GetInstance()
Definition: uwp_main.h:65
bool CheckWindowResized()
Definition: uwp_main.h:63
dictionary args
Definition: test_shaders.py:20
bool IsWindowVisible()
Definition: uwp_main.h:61
Definition: nk_menu.h:45
bool m_windowResized
Definition: uwp_main.h:72
bool m_windowVisible
Definition: uwp_main.h:70
const TString String(const int i, const int=10)
Definition: Common.h:220
void SetWindowResized()
Definition: uwp_main.h:64