App.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #pragma once
  2. #include "PolycodeTemplateApp.h"
  3. #include <wrl.h>
  4. #include <GLES2/gl2.h>
  5. #include <GLES2/gl2ext.h>
  6. #include <EGL/egl.h>
  7. #include <EGL/eglext.h>
  8. #include <EGL/eglplatform.h>
  9. #include <angle_windowsstore.h>
  10. using namespace Windows::Foundation::Collections;
  11. namespace TemplateApp
  12. {
  13. // Main entry point for our app. Connects the app with the Windows shell and handles application lifecycle events.
  14. ref class App sealed : public Windows::ApplicationModel::Core::IFrameworkView
  15. {
  16. public:
  17. App();
  18. // IFrameworkView methods.
  19. virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
  20. virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
  21. virtual void Load(Platform::String^ entryPoint);
  22. virtual void Run();
  23. virtual void Uninitialize();
  24. protected:
  25. // Application lifecycle event handlers.
  26. void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
  27. void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
  28. void OnResuming(Platform::Object^ sender, Platform::Object^ args);
  29. // Window event handlers.
  30. void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
  31. void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
  32. void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
  33. // DisplayInformation event handlers.
  34. void OnDpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
  35. void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
  36. void OnDisplayContentsInvalidated(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
  37. void OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
  38. void OnPointerMoved(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
  39. void OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
  40. private:
  41. bool m_windowClosed;
  42. bool m_windowVisible;
  43. PropertySet^ surfaceCreationProperties;
  44. PolycodeTemplateApp *app;
  45. EGLDisplay mEglDisplay;
  46. EGLContext mEglContext;
  47. EGLSurface mEglSurface;
  48. EGLint lastPanelWidth;
  49. EGLint lastPanelHeight;
  50. };
  51. }
  52. ref class Direct3DApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
  53. {
  54. public:
  55. virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView();
  56. };