Read desc
- Moved UWP specific functions to uwp_events.h - Removed BaseApp. - Implemented example UWP lifecycle.
This commit is contained in:
parent
8061116f0e
commit
0357230af8
1 changed files with 674 additions and 755 deletions
|
|
@ -4,22 +4,46 @@
|
|||
|
||||
#include "pch.h"
|
||||
|
||||
// Define what header we use for BaseApp.h
|
||||
#define PCH "pch.h"
|
||||
|
||||
// Enable hold hack
|
||||
#define HOLDHACK
|
||||
|
||||
#include "BaseApp.h"
|
||||
|
||||
namespace raylibUWP
|
||||
{
|
||||
ref class App sealed : public BaseApp
|
||||
ref class App sealed : public Windows::ApplicationModel::Core::IFrameworkView
|
||||
{
|
||||
public:
|
||||
public:
|
||||
App();
|
||||
|
||||
App();
|
||||
// IFrameworkView methods.
|
||||
void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView) override;
|
||||
void SetWindow(Windows::UI::Core::CoreWindow^ window) override;
|
||||
void Load(Platform::String^ entryPoint) override;
|
||||
void Run() override;
|
||||
void Uninitialize() override;
|
||||
private:
|
||||
bool mWindowVisible = true;
|
||||
bool mSuspended = false;
|
||||
|
||||
void Update() override;
|
||||
void GameLoop();
|
||||
void ProcessGamepads();
|
||||
|
||||
// Helpers
|
||||
int GetRaylibKey(Windows::System::VirtualKey kVey);
|
||||
|
||||
// Events
|
||||
void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
|
||||
void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
|
||||
void OnResuming(Platform::Object^ sender, Platform::Object^ args);
|
||||
void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
|
||||
void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
|
||||
void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
|
||||
void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
|
||||
void OnPointerWheelChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
|
||||
void OnPointerMoved(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
|
||||
void OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
|
||||
void OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
|
||||
};
|
||||
|
||||
ref class AppSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
|
||||
{
|
||||
public:
|
||||
Windows::ApplicationModel::Core::IFrameworkView^ CreateView() override;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue