App.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. Polycode::Core *core;
  46. EGLDisplay mEglDisplay;
  47. EGLContext mEglContext;
  48. EGLSurface mEglSurface;
  49. EGLint lastPanelWidth;
  50. EGLint lastPanelHeight;
  51. };
  52. }
  53. ref class Direct3DApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
  54. {
  55. public:
  56. virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView();
  57. };